Create admin user
Install sudo on Proxmox
1. Install sudo (if not present)
apt update && apt install sudo
2. Create an Administrative User
The script below will:
- Create a new user (replace
asdand password as needed). - Add the user to the
sudogroup. - Create an admin group in Proxmox's user management.
- Assign the
Administratorrole.
USER="asd"
PASS="asd"
COMMENT="System Administrator"
if ! id "$USER" &>/dev/null; then
sudo useradd -m -s /bin/bash -G sudo "$USER" && echo "$USER:$PASS" | sudo chpasswd
fi
pveum groupadd admin --comment "${COMMENT} group" 2>/dev/null
pveum aclmod / --group admin --role Administrator
pveum useradd "${USER}@pam" --comment "${COMMENT}" --groups admin 2>/dev/null
3. Remove the Created User and Group
To delete the user and associated group:
USER="asd"
sudo deluser --remove-home "$USER"
pveum user delete "${USER}@pam" 2>/dev/null
pveum group remove admin 2>/dev/null
4. (Optional) Disable Root GUI Access
For enhanced security, disable root login for the Proxmox web GUI:
pveum user modify root@pam --enable 0
To re-enable root access to GUI:
pveum user modify root@pam --enable 1
Notes:
- Change all hardcoded credentials before using in production!
- Assigning
Administratorto a non-root user allows you to safely disable root UI access. - All commands require root/sudo privileges on your Proxmox host.