Skip to content

Instantly share code, notes, and snippets.

@blgnksy
Last active June 16, 2022 13:46
Show Gist options
  • Save blgnksy/8a81f6d275ea4d5f7ab05d92f1ce3c72 to your computer and use it in GitHub Desktop.
Save blgnksy/8a81f6d275ea4d5f7ab05d92f1ce3c72 to your computer and use it in GitHub Desktop.
Using SSH Keys instead of password

Using SSH Keys instead of password

  1. Create a ssh-key in host machine
ssh-keygen -f ~/.ssh/blgnksy-key-rsa -t rsa -b 4096
  1. Add key to ssh
ssh-add  ~/.ssh/blgnksy-key-rsa
  1. Copy the contents of public key file
ssh-copy-id -i ~/.ssh/blgnksy-key-rsa user@host
  1. Make sure of permissions on remote

    /home/user/.ssh 700

    /home/user/.ssh/authorized_keys 600

    /home/user 700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment