Operating System - Linux
1753560 Members
6024 Online
108796 Solutions
New Discussion юеВ

How to restrict root login using SSH

 
SOLVED
Go to solution
viswanathkishore
New Member

How to restrict root login using SSH

Hi All,

I would like to restrict direct root login to the server using sshd?

Thanx in advance........
4 REPLIES 4
J. Maestre
Honored Contributor

Re: How to restrict root login using SSH

Edit /etc/ssh/sshd_config (path may vary depending on the distro) and add this:

PermitRootLogin no

Then restart the sshd daemon.
Steven E. Protter
Exalted Contributor

Re: How to restrict root login using SSH

Shalom,

http://www.hpux.ws/?p=19

You can block it with sshd_config but you better make sure first su - root works.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jared Middleton
Frequent Advisor
Solution

Re: How to restrict root login using SSH

On Red Hat Enterprise Linux, here's how I configure SSH to deny remote root logins that rely upon password entry:
cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.orig
vi /etc/ssh/sshd_config
-------------------------------
#PermitRootLogin yes
PermitRootLogin without-password
-------------------------------
/etc/init.d/sshd restart
viswanathkishore
New Member

Re: How to restrict root login using SSH

Hi,

This is working. Thanx for the Solution.