Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################
- ## ##
- ## Secure SSH ##
- ## ##
- ################
- ~$ cd ~
- ~$ mkdir .ssh && cd .ssh && ssh-keygen -o -a 100 -t ed25519
- ~$ cat id_ed25519.pub >> authorized_keys
- ~$ chmod 600 authorized_keys && cd .. && chmod 700 .ssh
- --- 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 ---
- ~$ sudo nano /etc/ssh/sshd_config
- |
- Port 24
- |----------------------------------------------
- # Authentication:
- LoginGraceTime 120
- PermitRootLogin no
- StrictModes yes
- # |-----------------------------------------------
- AuthorizedKeysFile %h/.ssh/authorized_keys
- PermitEmptyPasswords no
- ChallengeResponseAuthentication no
- PasswordAuthentication no
- # |-----------------------------------------------
- ## SAVE AND EXIT
- ~$ sudo /etc/init.d/ssh restart
- --- 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