一旦ログアウト後、再度クライント側の端末コンソールからサーバに接続してみる。
“Are you sure you want to continue connecting (yes/no)?” で yes 応答、その後パスワードを入力すれば接続できる。
123456789101112131415
# ssh -p 9999 192.168.11.3
The authenticity of host '[192.168.11.3]:9999([192.168.11.3]:9999)' can't be established.
ECDSA key fingerprint is a0:af:72:a5:a2:37:39:3f:c2:c9:7d:5c:e7:d5:d8:fd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.11.3]:9999' (ECDSA) to the list of known hosts.
masaru@192.168.11.3's password:
Linux noah 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) 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: Thu Jul 13 23:51:48 2017 from 192.168.11.13
$ 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 -p 9999 192.168.11.3
Linux vbox 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u1 (2017-06-18) 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: Tue Jun 20 23:28:25 2017 from 192.168.11.13
2回目からは以下のコマンドでよい。(DNS 環境が整っているのなら、 IP アドレスでなくホスト名でもよい)