To make a user always admin on an Ubuntu server:
Grant the user passwordless sudo access:
Edit the sudoers file using visudo
to ensure syntax correctness:
sudo visudo
Add the following line to the file, replacing username
with the actual username:
username ALL=(ALL) NOPASSWD: ALL
This configuration allows username
to run any command without being prompted for a password.
Alternatively, you can give a user root access directly (not recommended due to security risks):
sudo usermod -aG sudo username