Operating System - HP-UX
1833989 Members
2008 Online
110063 Solutions
New Discussion

sshd editing/ switch off root login permission

 
SOLVED
Go to solution
Oliver Schmitz
Regular Advisor

sshd editing/ switch off root login permission

Dear all,

I would like to switch of the possibility to log in directly as root user via ssh. Therefore I know that I have to edit the sshd_config file and set
PermitRootLogin no

The question is which sshd_config file to edit. I see on my maschine the following files:
./opt/ssh/newconfig/opt/ssh/etc/sshd_config
./opt/ssh/src/ssh/sshd_config
./opt/ssh/etc/sshd_config

Which one is the appropriate one?

Thanks in advance,

Oliver
Oliver Schmitz
2 REPLIES 2
Slawomir Gora
Honored Contributor
Solution

Re: sshd editing/ switch off root login permission

Hi,

/opt/ssh/etc/sshd_config

and restart sshd
Muthukumar_5
Honored Contributor

Re: sshd editing/ switch off root login permission

You can do it on ./opt/ssh/src/ssh/sshd_config file.

SSHD (eamon) will control the login.

You can also control them using /.profile as,

if [[ $LOGNAME = "root" ]]
then
ps | grep -q "ssh"
if [[ $? -eq 0 ]]
then
exit 0
fi
fi

It will do your requirement also.
Easy to suggest when don't know about the problem!