Skip to content

Instantly share code, notes, and snippets.

@stefanopulze
Last active June 25, 2022 13:31
Show Gist options
  • Save stefanopulze/c2b6c19990a32316d9614ecd22a18b8a to your computer and use it in GitHub Desktop.
Save stefanopulze/c2b6c19990a32316d9614ecd22a18b8a to your computer and use it in GitHub Desktop.
ssh without password
# Generate private/public key
> ssh-keygen -t ecdsa -b 521
> ssh-keygen -t ed25519
> ssh-keygen -t ecdsa -b 521 -f ./certs -m PEM
# Add private key
> ssh-add -K ~/.ssh/identity_file
# Copy public key to remote host
> ssh-copy-id -i ~/.ssh/identity_file username@remote_host_ip
# > insert the remote host password
# Now try to connect with
> ssh username@remote_host_ip
# Other notes
Put the public key in .ssh/authorized_keys
Change the permissions of .ssh to 700
Change the permissions of .ssh/authorized_keys to 640
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment