Disable root connect to server by ssh-client.

After I started my server [FC4], I would be disable root connect to this server by ssh-client. This is solution .

1. Open file /etc/ssh/sshd_config

# vi /etc/ssh/sshd_config

2. Uncomment this line has “PermitRootLogin yes” and change yes to no

:
#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
:

3. Restart sshd service.

# service sshd restart

4. If you don’t want to disconnect by client (because you connect by ssh-client) you can kill sshd process by use -1 option such as

# pkill -1 sshd

this option can help you keep connection between client&server because this command will be kill process -> reload new config -> start sshd process same sshd old process id.

Related Posts

  • No Related Post
This entry was posted in linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">