【发布时间】:2015-10-01 11:15:34
【问题描述】:
我正在尝试为 Amazon EC2 Ubuntu 实例创建一个身份验证过程,该过程需要使用由 Amazon 生成的密钥对并使用 Google-Authenticator。因此,我想使用我的 pem 文件登录到实例,然后使用验证码提示进行提示。
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 ubuntu@*.*.*.*
如何让 OpenSSH 通过 pem 文件进行身份验证 --> google-authenticator?
谢谢!
【问题讨论】:
标签: authentication amazon-web-services amazon-ec2 openssh sshd