Skip to content

Instantly share code, notes, and snippets.

@tirzasrwn
Last active May 27, 2022 04:35
Show Gist options
  • Save tirzasrwn/da1476116c835c708d34e02cb45082de to your computer and use it in GitHub Desktop.
Save tirzasrwn/da1476116c835c708d34e02cb45082de to your computer and use it in GitHub Desktop.
Automate SSH login password

Client-side

ssh-keygen -t rsa -b 2048 # Enter twice
# Will create file ~/.ssh/id_rsa  ~/.ssh/id_rsa.pub
ssh-copy-id <server-user>@<server-ip> # This will ask you ssh-sever-password

# Test your work. It's should automate without password.
ssh <server-user>@<server-ip>

Server-side

On server side, ssh-copy-id will create ~/.ssh/authorized_keys file.

Reference

https://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password

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