我正在嘗試爲亞馬遜EC2 Ubuntu實例創建身份驗證過程,該實例將要求使用Amazon生成的密鑰對,並使用Google-Authenticator。 Ergo我想用我的pem文件登錄到實例,然後提示驗證碼提示。如何創建一個pem文件+ google-authenticator訪問Amazon EC2?
Verification code:
我設法使用我的pem文件登錄到我的服務器。我還設法成功安裝Google-Authenticator,並使用它來與我創建並提供特定密碼的單獨用戶(而不是ubuntu)一起登錄。
在我/etc/ssh/sshd_config
我:
ChallengeResponseAuthentication yes
PasswordAuthentication no
UsePAM yes
AuthenticationMethods keyboard-interactive
和我/etc/pam.d/sshd
:
@include common-auth
auth required pam_google_authenticator.so
如果我添加publickey
到AuthenticationMethods
然後在登錄時提示我輸入密碼,而不是使用PEM我提供的文件:
ssh -i my-key.pem [email protected]*.*.*.*
我如何獲得OpenSSH通過pem文件進行身份驗證 - > google-authenticator?
謝謝!