Advertisement
Guest User

Untitled

a guest
Sep 7th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. ################
  2. ## ##
  3. ## Secure SSH ##
  4. ## ##
  5. ################
  6.  
  7. ~$ cd ~
  8.  
  9. ~$ mkdir .ssh && cd .ssh && ssh-keygen -o -a 100 -t ed25519
  10.  
  11. ~$ cat id_ed25519.pub >> authorized_keys
  12.  
  13. ~$ chmod 600 authorized_keys && cd .. && chmod 700 .ssh
  14.  
  15. --- save the private key (id_XXXXXXX) to your hard drive. then delete the private key (id_XXXXXXX) and the public key (id_XXXXXXX.pub) on your server ---
  16.  
  17. ~$ sudo nano /etc/ssh/sshd_config
  18. |
  19. Port 24
  20. |----------------------------------------------
  21. # Authentication:
  22. LoginGraceTime 120
  23. PermitRootLogin no
  24. StrictModes yes
  25. # |-----------------------------------------------
  26. AuthorizedKeysFile %h/.ssh/authorized_keys
  27. PermitEmptyPasswords no
  28. ChallengeResponseAuthentication no
  29. PasswordAuthentication no
  30. # |-----------------------------------------------
  31.  
  32. ## SAVE AND EXIT
  33.  
  34. ~$ sudo /etc/init.d/ssh restart
  35.  
  36. --- start a new putty session to your server with the new port, log into your server with the private key - if this was successfull exit the old session by typing `exit` ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement