memorandum
FrontPage
管理
ヘルプ
VineLinux3.x/init/鍵交換方式によるSSH接続
をテンプレートにして作成
開始行:
*概要 [#ne37600e]
Vine Linux 3.1によるサーバ構築 にも書いているように、標準...
なお、ここではすでに[[パスワードによる認証:http://kayanom...
*鍵による認証 [#sa3e3694]
**SSH2の鍵を作成 [#i0c6de3c]
鍵を作成するユーザーになる。
# su - test
鍵の作成
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_...
Created directory '/home/test/.ssh'.
Enter passphrase (empty for no passphrase): ←パスワー...
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id...
Your public key has been saved in /home/test/.ssh/id_rsa...
The key fingerprint is:
07:8b:30:3c:9f:c3:96:b1:7b:68:4f:8c:cf:ec:e0:6f test@x22
確認
ユーザーディレクトリの.sshディレクトリの中に作成される。
$ ls -l /home/test/.ssh/
合計 8
-rw------- 1 test test 951 Aug 11 15:54 ...
-rw-r--r-- 1 test test 218 Aug 11 15:54 ...
公開鍵の名前変更
$ cd .ssh/
$ mv id_rsa.pub authorized_keys
公開鍵のアクセス権変更
$ chmod 600 authorized_keys
確認
$ ls -l
合計 8
-rw------- 1 test test 218 Aug 11 15:54 ...
-rw------- 1 test test 951 Aug 11 15:54 ...
**鍵をクライアントに移動する [#u8cbf167]
WinSCPなどでクライアントから接続し、.sshディレクトリにあ...
#ref(move.png)
右ドラッグして、コピーではなく移動を選択する。
**sshd_configの編集 [#ne90078a]
rootになる。
# su -
Password:
# vi /etc/ssh/sshd_config
>
PubkeyAuthentication yes
公開鍵認証を許可
PasswordAuthentication no
パスワードによる認証を禁止(鍵方式のみ)
**sshdの再起動 [#cd5c353a]
# /etc/rc.d/init.d/sshd restart
sshdを停止中: ...
sshdを起動中: ...
これで、パスワードによる認証はできなくなり、鍵を使わない...
クライアントからSSHで接続
* コメント [#sb81891f]
#comment
終了行:
*概要 [#ne37600e]
Vine Linux 3.1によるサーバ構築 にも書いているように、標準...
なお、ここではすでに[[パスワードによる認証:http://kayanom...
*鍵による認証 [#sa3e3694]
**SSH2の鍵を作成 [#i0c6de3c]
鍵を作成するユーザーになる。
# su - test
鍵の作成
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_...
Created directory '/home/test/.ssh'.
Enter passphrase (empty for no passphrase): ←パスワー...
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id...
Your public key has been saved in /home/test/.ssh/id_rsa...
The key fingerprint is:
07:8b:30:3c:9f:c3:96:b1:7b:68:4f:8c:cf:ec:e0:6f test@x22
確認
ユーザーディレクトリの.sshディレクトリの中に作成される。
$ ls -l /home/test/.ssh/
合計 8
-rw------- 1 test test 951 Aug 11 15:54 ...
-rw-r--r-- 1 test test 218 Aug 11 15:54 ...
公開鍵の名前変更
$ cd .ssh/
$ mv id_rsa.pub authorized_keys
公開鍵のアクセス権変更
$ chmod 600 authorized_keys
確認
$ ls -l
合計 8
-rw------- 1 test test 218 Aug 11 15:54 ...
-rw------- 1 test test 951 Aug 11 15:54 ...
**鍵をクライアントに移動する [#u8cbf167]
WinSCPなどでクライアントから接続し、.sshディレクトリにあ...
#ref(move.png)
右ドラッグして、コピーではなく移動を選択する。
**sshd_configの編集 [#ne90078a]
rootになる。
# su -
Password:
# vi /etc/ssh/sshd_config
>
PubkeyAuthentication yes
公開鍵認証を許可
PasswordAuthentication no
パスワードによる認証を禁止(鍵方式のみ)
**sshdの再起動 [#cd5c353a]
# /etc/rc.d/init.d/sshd restart
sshdを停止中: ...
sshdを起動中: ...
これで、パスワードによる認証はできなくなり、鍵を使わない...
クライアントからSSHで接続
* コメント [#sb81891f]
#comment
ページ名:
検索
AND検索
OR検索
編集操作
一覧
単語検索
最終更新
バックアップ
ヘルプ
トップページ
http://kayanomori.net/
↑
アクセス数
本日:0人
昨日:0人
総数:0人
現在:7人
最新の20件
2022-07-16
投票箱
2022-01-30
FrontPage
2022-01-29
めも
2018-02-03
SandBox
PukiWiki
InterWikiName
FormattingRules
PukiWiki/1.4/Manual/Plugin/O-R
PukiWiki/1.4/Manual/Plugin/S-U
InterWiki
日本語
複数画像アップ掲示板 ECOUP(エコアップ) v1.31
日記/2006-12-12
日記
日記/2005-10-04
特定のオートコンプリート履歴だけを削除する
日記/2005-10-06
小ネタ集/WordPress
日記/2005-10-05
整形ルール
edit