Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhducbkhn/3e14b47103c4cc48086fd2562d776117 to your computer and use it in GitHub Desktop.
Save anhducbkhn/3e14b47103c4cc48086fd2562d776117 to your computer and use it in GitHub Desktop.
Configure SSH Key Authentication on a linux server
# Client, generate a ssh key pair if needed
ssh-keygen
# Copy public key to server
ssh-copy-id username@IP
# Disable the Password for Root Login on server
sudo nano /etc/ssh/sshd_config
--> PermitRootLogin without-password
reload ssh
# login
ssh username@IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment