【Linux】禁止密碼登入(使用金鑰)

修改 /etc/ssh/sshd_config

vim /etc/ssh/sshd_config

## 修改 PubkeyAuthentication

PubkeyAuthentication yes
#使用 ssh key 登入
PasswordAuthentication no
#禁止密碼登入

重啟 ssh 服務

sudo systemctl restart sshd.service

 


修訂版本 #1
由 treeman 建立於 2023-01-24 18:48:54 CST
由 treeman 更新於 2023-05-05 02:14:58 CST