Created
February 18, 2014 04:00
-
-
Save mountcedar/9064433 to your computer and use it in GitHub Desktop.
sshで公開鍵認証を使ってアクセスする ref: http://qiita.com/mountcedar/items/43157ff1225c56500655
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
$ cd ~/.ssh | |
$ ssh-keygen -t rsa -f <filename> |
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
$ scp <filename>.pub <hostname>:.ssh/. |
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
$ mv <filename> id_rsa | |
$ chmod 600 id_rsa |
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
$ ssh <hostname> | |
<パスワードによるログイン> | |
$ cd .ssh | |
$ cat <filename>.pub >> authorized_keys | |
$ chmod 600 authorized_keys | |
$ exit |
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
$ ssh <hostname> | |
$ |
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
$ mkdir .ssh | |
$ chmod 700 .ssh |
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
$ ls -al .ssh |
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
$ chmod 600 <target> |
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
$ ssh -i ~/.ssh/<privatekey> <hostname> |
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
Host <hostname or nickname> | |
HostName <hostname or ip address> | |
User <username> | |
Port <port number> | |
UserKnownHostsFile /dev/null | |
StrictHostKeyChecking no | |
PasswordAuthentication no | |
IdentityFile ~/.ssh/<privatekey> | |
IdentitiesOnly yes | |
LogLevel FATAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment