この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:network:sshkey [2015/06/10 21:02] kota [手順3] |
ja:network:sshkey [2015/06/14 02:49] (現在) kota [手順1] |
||
---|---|---|---|
ライン 25: | ライン 25: | ||
Generating public/private rsa key pair. | Generating public/private rsa key pair. | ||
Enter file in which to save the key (/home/hoge/.ssh/id_rsa): <-鍵のファイルの名前を聞かれるので入力 | Enter file in which to save the key (/home/hoge/.ssh/id_rsa): <-鍵のファイルの名前を聞かれるので入力 | ||
- | Enter passphrase (empty for no passphrase): <-パスフレーズを聞かれるので入力(空のままEnterでも良い) | + | Enter passphrase (empty for no passphrase): <-パスフレーズを聞かれる(空のままEnter) |
- | Enter same passphrase again: <-パスフレーズ再入力 | + | Enter same passphrase again: <-パスフレーズ再入力(空のままEnter) |
Your identification has been saved in /home/hoge/.ssh/id_rsa. <- 秘密鍵を作成 | Your identification has been saved in /home/hoge/.ssh/id_rsa. <- 秘密鍵を作成 | ||
Your public key has been saved in /home/hoge/.ssh/id_rsa.pub. <-公開鍵を作成 | Your public key has been saved in /home/hoge/.ssh/id_rsa.pub. <-公開鍵を作成 | ||
ライン 55: | ライン 55: | ||
✳︎ authorized_keysのpermissionは600にしておく '' chmod 600 ~/.ssh/authorized_keys '' | ✳︎ authorized_keysのpermissionは600にしておく '' chmod 600 ~/.ssh/authorized_keys '' | ||
+ | |||
+ | また、/etc/ssh/sshd_config を編集。\\ | ||
+ | 以下についてコメントアウトを解除して、activate | ||
+ | <code> | ||
+ | RSAAuthentication yes | ||
+ | PubkeyAuthentication yes | ||
+ | AuthorizedKeysFile .ssh/authorized_keys | ||
+ | </code> | ||
---- | ---- | ||
ライン 68: | ライン 76: | ||
こうしておけば | こうしておけば | ||
- | <code> | + | '' |
$ ssh hoge | $ ssh hoge | ||
- | </code> | + | '' |
でパスワード認証無しでloginできる。 | でパスワード認証無しでloginできる。 | ||
+ | |||
+ | ✳︎この設定がなくとも | ||
+ | '' | ||
+ | $ ssh -i ~/.ssh/id_rsa namae@hostname | ||
+ | '' | ||
+ | でloginできる |