SSH接続できない
macかららずぱいにリモートログインする際、いつも通りに以下を実行。
ssh pi@192.168.100.100
しかし以下のエラーが出て失敗。
ssh: connect to host 192.168.100.133 port 22: Connection refused
ネットワーク研究室出身舐めんな全然わけわかんねえわ。Google先生おなしゃす。。。調べてみるとどうやらラズパイ側でsshが有効になっていないみたい。
ラズパイでSSHを有効にする
sudo raspi-config
を打つと設定画面のようなものが出てくるので『5 Interfacing Options』を選択し、SSHの欄があるので有効にする。(7番のAdvancedOptionじゃないから気をつけて、ネットには嘘が転がってることをここで痛感したよ)
いざもう一度挑戦。
▶ssh pi@192.168.100.133
The authenticity of host '192.168.100.133 (192.168.100.133)' can't be established.
ECDSA key fingerprint is SHA256:Zw5rQnbyocScmvQmGLTljgAYxrAwRFz51TNM51ALVEc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.133' (ECDSA) to the list of known hosts.
pi@192.168.100.133's password:
おっ、いけた!
パスワードは知らんけどrootやろと思い入力するも、、、
Permission denied, please try again.
ふざけんな、、、rootじゃなかったらpiか?pipiか?→弾かれます。
もう一度sudo raspi-config
で設定を開き『1 Change User Password』をタップ!パスワード変更!!
▶ssh pi@192.168.100.133
pi@192.168.100.133's password:
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 Apr 10 10:10:02 2017
pi@raspberrypi:~ $
GooD!!ログインできました!
まとめ
らずぱい初起動したらとりあえずsudo raspi-config
。
→パスワード変更(セキュリティ的にも変更は必須ですよね)
→SSHをenable(有効)に。