Created
December 6, 2019 02:22
-
-
Save kyle-seongwoo-jun/e31a74076ca068e1beaf94a3fbc505fe to your computer and use it in GitHub Desktop.
ssh-keygen to login without password
This file contains hidden or 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 ssh key | |
$ ssh-keygen -t rsa | |
# create .ssh/authorized_keys on server | |
# and paste client ssh key | |
# and set permission | |
$ ssh $username@$hostname mkdir -p .ssh | |
$ cat .ssh/id_rsa.pub | ssh $username@$hostname 'cat >> .ssh/authorized_keys' | |
$ ssh $username@$hostname "chmod 700 .ssh; chmod 640 .ssh/authorized_keys" | |
# connect without password | |
$ ssh $username@$hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment