User Tools

Site Tools


wiki:server:config:disableroot

Disable root SSH Login and Create sudo User

Edit /etc/ssh/sshd_config:

vi /etc/ssh/sshd_config

Change:

PermitRootLogin yes

To:

PermitRootLogin no

Restart sshd:

systemctl restart sshd

Add new user:

useradd -d /home/<NEWUSER> -m <NEWUSER>

Change new user's password

passwd <NEWUSER>

Change default shell to bash:

chsh -s /bin/bash <NEWUSER>

Run visudo to add Full Sudo Privilege to the new user:

visudo

Add below to the end of the file:

<NEWUSER> ALL = NOPASSWD: ALL
wiki/server/config/disableroot.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki