- Create a new user. In the following example, we will name it bob.
- Set the password for the new user.
- In order to add sudo permissions for the new user, add
bob ALL=(ALL) ALL
in/etc/sudoers
or add bob in wheel group withusermod -a -G wheel bob
. - Try to connect SSH with bob user.
- Verify you can switch user to root with bob.
- Disable root SSH login:
- Edit
# vim /etc/ssh/sshd_config
- and change
#PermitRootLogin yes
intoPermitRootLogin no
.
- Now, we can restart SSH server.