Hom*_*mer 7 google-compute-engine
是否有可能为Google计算引擎启用2因素身份验证(或Google术语的2步验证)?我有兴趣保护我的虚拟机,云存储和开发人员控制台.
我尝试过使用Google身份验证器(libapm)参考这篇文章使用Google身份验证器在VM上使用双重身份验证来保护SSH但是它没有成功(我设法使用gcloud计算机shell登录而没有其他代码).
[1月12日]一些更新:Google开发者控制台完美运行.谢谢.
对于使用计算引擎SSH访问的两步验证,我重新尝试了所有内容.按照提供的链接中提到的说明进行操作,并执行以下操作:
所有这些测试都失败了 - 没有提示验证码.我查看了Google计算引擎文档,他们明确提到它们只支持证书身份验证(而不是用户名/密码),所以我无法验证这是否是根本原因.
是否有人使用Google计算引擎进行两步验证?
谢谢
最后 - 一个解决方案(感谢Google云支持).
在我提到的文档之上的几个更新:
除了在/etc/pam.d/sshd中添加一行之外,还应该注释掉@include common-auth行.所以它应该是这样的:
auth required pam_google_authenticator.so # from the original instructions
# @include common-auth # commenting out is new...
Run Code Online (Sandbox Code Playgroud)
除了更改/ etc/ssh/sshd_config中的ChallengeResponseAuthentication属性之外,还应该在以下行中添加AuthenticationMethods publickey,keyboard-interactive:
ChallengeResponseAuthentication yes # from the original instructions
AuthenticationMethods publickey,keyboard-interactive # this is new...
Run Code Online (Sandbox Code Playgroud)
当然,这是在安装libpam-google-authenticator,更改sshd和sshd_config(如上所述),重新启动ssh/sshd服务以及为帐户设置google-authenticator的常规说明之上.
最后,还有几点:
sudo apt-get install libpam-google-authenticator
祝好运!
| 归档时间: |
|
| 查看次数: |
1278 次 |
| 最近记录: |