1#Port 222 Port 9999# <= 適当に変更34#PermitRootLogin yes5 PermitRootLogin no # <= 変更
3. SSH サーバ再起動
設定を有効化するため、SSH サーバを再起動する。
1
# /etc/init.d/ssh restart
4. パスワード接続
クライント側の端末コンソールからサーバに接続してみる。
“Are you sure you want to continue connecting (yes/no)?” で yes 応答、その後パスワードを入力すれば接続できる。
12345678910111213141516
# ssh 192.168.11.102 -p 9999
The authenticity of host '192.168.11.102 (192.168.11.102)' can't be established.
ECDSA key fingerprint is 87:ed:8e:29:1f:c8:89:ee:6b:5c:c4:3f:a5:23:12:c5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.11.102' (ECDSA) to the list of known hosts.
masaru@192.168.11.102's password:
Linux vbox 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Sep 30 10:00:19 2013
masaru@vbox:~$
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/masaru/.ssh/id_rsa): /home/masaru/.ssh/id_rsa_vbox_debian
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/masaru/.ssh/id_rsa_vbox_debian.
Your public key has been saved in /home/masaru/.ssh/id_rsa_vbox_debian.pub.
The key fingerprint is:
96:af:59:18:9c:a0:c2:da:86:7e:d7:24:05:d0:31:da masaru@p183
The key's randomart image is:
+--[ RSA 2048]----+
| .oo. |
| oo. |
| . Eo |
| . . + o |
| o . . S |
| + . . o + |
|o o + . o |
|.. . . . + |
| .. . o |
+-----------------+
$ ssh -i ~/.ssh/id_rsa_vbox_debian 192.168.11.102
The authenticity of host '192.168.11.102 (192.168.11.102)' can't be established.
ECDSA key fingerprint is 87:ed:8e:29:1f:c8:89:ee:6b:5c:c4:3f:a5:23:12:c5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.11.102' (ECDSA) to the list of known hosts.
Enter passphrase for key '/home/masaru/.ssh/id_rsa_vbox_debian':
Linux vbox 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Sep 30 21:34:08 2013 from 192.168.11.13