Skip to content

Instantly share code, notes, and snippets.

@mountcedar
Created February 18, 2014 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mountcedar/9064433 to your computer and use it in GitHub Desktop.
Save mountcedar/9064433 to your computer and use it in GitHub Desktop.
sshで公開鍵認証を使ってアクセスする ref: http://qiita.com/mountcedar/items/43157ff1225c56500655
$ cd ~/.ssh
$ ssh-keygen -t rsa -f <filename>
$ scp <filename>.pub <hostname>:.ssh/.
$ mv <filename> id_rsa
$ chmod 600 id_rsa
$ ssh <hostname>
<パスワードによるログイン>
$ cd .ssh
$ cat <filename>.pub >> authorized_keys
$ chmod 600 authorized_keys
$ exit
$ ssh <hostname>
$
$ mkdir .ssh
$ chmod 700 .ssh
$ ls -al .ssh
$ chmod 600 <target>
$ ssh -i ~/.ssh/<privatekey> <hostname>
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