What is SSH? And how to protect root ssh (part 2)


SUBMITTED BY: teewaweth

DATE: May 21, 2017, 4:15 p.m.

FORMAT: Text only

SIZE: 1.6 kB

HITS: 732

  1. SSH (Secure Shell)
  2. Example of using SSH through PuTTY in Microsoft Windows 7
  3. From: http://www.sutenm.com
  4. Root ssh protection on centos
  5. How to Set SSH to not allow root login
  6. Today, the basic security of linux.
  7. That is, not to Root Access directly, but through other users.
  8. Let's see how better. Follow the next part 2.
  9. [Root @ valkyrie ~] # useradd
  10. To create a new user, use the ssh login instead of root.
  11. [Root @ valkyrie ~] # passwd
  12. Now set a password to it (recommended for each root).
  13. [Root @ valkyrie ~] # vi / etc / ssh / sshd_config
  14. Edit sshd_config offline
  15. Set PermitRootLogin to no.
  16. In the beginning it will be adjusted to yes, then comment with # to remove it.
  17. Then scroll down to the bottom. Type this line in.
  18. AllowUsers
  19. Then save the file off the mana.
  20. Now let's service sshd restart to re-order service sshd.
  21. Do not close this SSH before. Because we still do not know what configuration we use, there is no problem login to it?
  22. If not tested before May have to walk to solve the file page, because it will not ssh anymore.
  23. So, open the ssh terminal to the server again and try to login with root.
  24. I can not find it.
  25. Turn off the terminal and open ssh to the next page, then test the login with the user we created at the beginning.
  26. If it's ok, then go through.
  27. If we want to use root privileges
  28. It is because of the newly created user. It does not have the equivalent of Root, so the way to get us into Root is that.
  29. [Newusers @ valkyrie ~] $ su -
  30. It will type password root, then type root.

comments powered by Disqus