Skip to content

User Management in Debian

Add user account to sudoers group

  1. Elevate/switch to the root account by entering su - and authenticating with the root password
  2. Add the user account to the sudo group using the command usermod -aG sudo <username>
  3. Verify that the command was successful by running groups <username>

Disable login for root account

  1. Edit the sshd_config file in the text editor of your choice via the following command:
sudo nano /etc/ssh/sshd_config
  1. Locate the line that contains #PermitRootLogin yes and uncomment the # symbol and change the yes to no so it reads PermitRootLogin no
  2. You can also set the line to PermitRootLogin no-password (I think) to only allow logon via SSH auth keys
  3. Once root login has been disabled, you can make the change active by running any of the following commands:
/etc/init.d/sshd restart
systemctl restart sshd
service sshd restart