Skip to content

Instantly share code, notes, and snippets.

@nurulimamnotes
Created May 1, 2016 20:49
Show Gist options
  • Save nurulimamnotes/8aaf00709d5ea9715fc4fb1b0c4e56fa to your computer and use it in GitHub Desktop.
Save nurulimamnotes/8aaf00709d5ea9715fc4fb1b0c4e56fa to your computer and use it in GitHub Desktop.
Setup Private Key SSH Login & Change Default Port
ssh-keygen -b 2048 -t rsa
chmod 700 .ssh
mv .ssh/id_rsa.pub .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
cat .ssh/id_rsa
rm -rf .ssh/id_rsa
nano /etc/ssh/sshd_config
service sshd restart
ssh -i private-key -p 7777 root@hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment