關掉 RPi 的密碼登入功能


$ cd /etc/ssh
$ nano sshd_config
加入以下三行
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

存檔
重新啟動 ssh 服務
sudo systemctl restart ssh

最後你可以在 terminal 開另外一個 tab 來驗證是否成功:
ssh pi@your-ip -o PubKeyAuthentication=no
pi@your-ip: Permission denied (publickey).


留言