HPCHOST

Client Login Client Login

How do I disable root ssh login?

Before you do this make sure you have created another user in the wheel group.

 

# adduser testuser     (adds the user)
# passwd myuser    (sets the new user's password)
# usermod -G wheel testuser    (adds the new user to the wheel group)

To disable root login through ssh, edit the following file:

 

# /etc/ssh/sshd_config

browse to the following line:

 

PermitRootLogin yes

and change to:

 

PermitRootLogin no

Save the file and restart ssh.

 

# /etc/init.d/ssh restart


If you are ssh'd into the server with root when this is done, your connection will fail on the restart of ssh. Therefore, it is suggested to perform this maintenance through your IPMI console.


To add a user to the wheel group, run the following commands from the root shell: 



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
The VI Editor (Views: 166)



Close Chat
HPC Host Live Chat