Last active
June 25, 2022 13:31
-
-
Save stefanopulze/c2b6c19990a32316d9614ecd22a18b8a to your computer and use it in GitHub Desktop.
ssh without password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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