12
01
月
2021
首先安裝 Google Authenticator
apt install libpam-google-authenticator -y
接著執行 Google Authenticator
google-authenticator
過程中,都只要按下 y 下一步就可以
接著設定 /etc/pam.d/sshd
將 @include common-auth 註解掉,之後在下方插入以下代碼:
auth required pam_google_authenticator.so
接著修改 /etc/ssh/sshd_config
ChallengeResponseAuthentication yes
最後重啟 ssh
/etc/init.d/ssh restart
延伸閱讀
- 關閉 Debian/Ubuntu 使用 Ctrl + Alt + Del 來重啟
- Debian 10 + Bind9 9.16.3 編譯安裝
- 什麼是原生 IP?
- Debian 10 加入 sudo
- Debian 10 把 rc.local 加回來
- Debian 10 可以直接於 vim 中使用複製貼上
- 在 Debian 10 安裝 Wireguard (安全又快速的 VPN 隧道)
- 在 Debian 10 中增加 4G 連網 (本篇使用 wvdial)