そういうのがいいブログ

SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ

Proxmox9.0のインストール後の初期設定(その2)管理者ユーザー追加

※[PR]当ブログの記事の中にはプロモーションが含まれています。

・Proxmox9.0のインストール後に行う管理者ユーザーの追加について知りたい。 ・具体的な手順を分かりやすく教えてほしい。

こういった疑問に答えます。

本記事の内容

  1. Proxmox9.0のインストール後の管理者ユーザー追加

サトナカ (@souiunogaii)

この記事を書いている私は、某SIerに勤務しながら、
WEB系エンジニア・インフラエンジニアに憧れて、プログラミングおよびインフラ技術の勉強をしています。

こういった私が、解説していきます。

私が実機で試したコマンドや画像を載せて書いています。
記事の信頼性担保に繋がると思います。

Proxmox9.0のインストール後の初期設定(その2)管理者ユーザー追加

グループの追加

グループのアクセス権限の追加

  • ホストの再起動、シャットダウンを行うためには、「Administrator」も必要
  • それ以外の機能は、「PVEAdmin」で十分

ユーザーの追加

レルム「PAM」の方は、ホストOS自体にも同じ名前のユーザー追加が必要です。

OSにユーザー追加

Linux a-prxmx01 6.14.8-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.14.8-2 (2025-07-22T10:04Z) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Aug 25 21:07:40 2025 from 192.168.100.101
root@a-prxmx01:~# cd /home
mkdir /home/ユーザー名
useradd ユーザー名 -d /home/ユーザー名
passwd ユーザー名
root@a-prxmx01:/home# mkdir /home/satonaka
root@a-prxmx01:/home# useradd satonaka -d /home/satonaka
root@a-prxmx01:/home# passwd satonaka
新しいパスワード:
新しいパスワードを再入力してください:
passwd: パスワードは正しく更新されました
apt-get install sudo
root@a-prxmx01:~# apt-get install sudo
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了
状態情報を読み取っています... 完了
以下のパッケージが新たにインストールされます:
  sudo
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
2,087 kB のアーカイブを取得する必要があります。
この操作後に追加で 6,865 kB のディスク容量が消費されます。
取得:1 http://deb.debian.org/debian trixie/main amd64 sudo amd64 1.9.16p2-3 [2,087 kB]
2,087 kB を 0秒 で取得しました (8,578 kB/s)
以前に未選択のパッケージ sudo を選択しています。
(データベースを読み込んでいます ... 現在 51420 個のファイルとディレクトリがインストールされています 。)
.../sudo_1.9.16p2-3_amd64.deb を展開する準備をしています ...
sudo (1.9.16p2-3) を展開しています...
sudo (1.9.16p2-3) を設定しています ...
man-db (2.13.1-1) のトリガを処理しています ...
libc-bin (2.41-12) のトリガを処理しています ...
/etc/sudoers
# See sudoers(5) for more information on "@include" directives: 
    
@includedir /etc/sudoers.d  
satonaka    ALL=(ALL:ALL) ALL   ←★★★追加
groupadd wheel
usermod -g wheel ユーザー名
root@a-prxmx01:~# groupadd wheel
root@a-prxmx01:~# usermod -g wheel satonaka
root@a-prxmx01:~# id satonaka
uid=1000(satonaka) gid=1001(wheel) groups=1001(wheel),27(sudo)
/etc/pam.d/su
#
# The PAM configuration file for the Shadow `su' service
#

# This allows root to su without passwords (normal operation)
auth       sufficient pam_rootok.so

# Uncomment this to force users to be a member of group wheel
# before they can use `su'. You can also add "group=foo"
# to the end of this line if you want to use a group other
# than the default "wheel" (but this may have side effect of
# denying "root" user, unless she's a member of "foo" or explicitly
# permitted earlier by e.g. "sufficient pam_rootok.so").
# (Replaces the `SU_WHEEL_ONLY' option from login.defs)
auth       required   pam_wheel.so   ←★★★コメント解除して有効化

ログインできるか確認