[英]2FA is not working with Ubuntu AWS instance
我在 EC2 實例中執行 ssh 時致力於設置 2FA。 但是在設置實例之后仍然不要求 2FA 代碼並直接將我的用戶即ubuntu
到服務器。
我按照以下步驟設置 2FA:
安裝 Google Authenticator PAM 模塊。
sudo apt 安裝 libpam-google-authenticator
添加auth required pam_google_authenticator.so
到/etc/pam.d/sshd
重啟 ssh sudo systemctl restart sshd.service
使用以下內容更新 sshd_config:
ChallengeResponseAuthentication yes PasswordAuthentication no
運行命令google-authenticator
請幫我解決這個問題。 提前致謝。
由於啟用了其他配置,我遇到了這個問題。 使用 PubKeyAuthentication 而不是身份驗證器。 我將其更改為PubKeyAuthentication no
,這解決了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.