内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
01_linux
»
01_net
»
06 sshでパスワードなしにログインするには
トレース:
01_linux:01_net:06_sshd鍵
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 06 sshでパスワードなしにログインするには ====== ^ログイン元|| |ホスト名|ssh-host01| |IP|192.168.10.20| |ユーザ|hoge2| ^リモート側|| |ホスト名|ssh-host02| |IP|192.168.10.50| |ユーザ|hoge5| ===== ①ログイン元で鍵作成 ===== 下記で、$HOME/.ssh/ディレクトリに秘密鍵(id_rsa)と公開鍵(id_rsa.pub)が作成される。 <color red>※ログイン元(ユーザ:hoge2)のユーザで作成</color> <code console> hoge2@ssh-host01 $ ssh-keygen -t rsa ←RSA暗号方式の鍵を作成 Generating public/private rsa key pair. Enter file in which to save the key (/home/nori/.ssh/id_rsa): ←[Enter]キー Enter passphrase (empty for no passphrase): ←パスフレーズを入力 Enter same passphrase again: ←同じパスフレーズを入力 Your identification has been saved in /home/nori/.ssh/id_rsa. Your public key has been saved in /home/nori/.ssh/id_rsa.pub. The key fingerprint is: f9:81:b6:c7:8f:b9:aa:3e:0e:c6:bd:35:19:a1:1e:06 nori@pandora </code> ===== ②リモート側で公開鍵をコピー ===== 次に、リモート側で、先ほど作成した公開鍵を ~/.ssh/authorized_keysに追加し、パーミッションを600に変更する。 <color red>※ログイン元(ユーザ:hoge5)のユーザで作成</color> <code console> hoge5@ssh-host02 $ cat id_rsa.pub >> $HOME/.ssh/authorized_keys hoge5@ssh-host01 $ chmod 600 $HOME/.ssh/authorized_keys </code> ===== ③ログイン確認 ===== ログイン元(ユーザ:hoge2)から、リモート側(ユーザ:hoge5)へsshし鍵でログインできる事を確認 <code console> hoge2@ssh-host01 $ ssh hoge5@[リモート側IP] </code> {{tag>ssh}}
01_linux/01_net/06_sshd鍵.txt
· 最終更新: 2015/12/04 03:39 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ