簡體   English   中英

2FA 不適用於 Ubuntu AWS 實例

[英]2FA is not working with Ubuntu AWS instance

我在 EC2 實例中執行 ssh 時致力於設置 2FA。 但是在設置實例之后仍然不要求 2FA 代碼並直接將我的用戶即ubuntu到服務器。

我按照以下步驟設置 2FA:

  1. 安裝 Google Authenticator PAM 模塊。

    sudo apt 安裝 libpam-google-authenticator

  2. 添加auth required pam_google_authenticator.so/etc/pam.d/sshd

  3. 重啟 ssh sudo systemctl restart sshd.service

  4. 使用以下內容更新 sshd_config:

    ChallengeResponseAuthentication yes PasswordAuthentication no

  5. 運行命令google-authenticator

請幫我解決這個問題。 提前致謝。

由於啟用了其他配置,我遇到了這個問題。 使用 PubKeyAuthentication 而不是身份驗證器。 我將其更改為PubKeyAuthentication no ,這解決了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM