我有一个 Ubuntu 服务器,它有一个私有的、内部的、IP 和一个面向公众的 IP。我想在公共端为 SSH 设置两因素身份验证。这可能吗?我计划使用 Google Authenticator,但我也愿意接受其他想法。
Mic*_*ton 16
是的,您可以使用pam_access.so. 此配方取自Google Authenticator的wiki:
一个有用的 PAM 方法是允许在连接源自某些来源时跳过双因素身份验证。这已经由 PAM 支持。例如, pam_access 模块可用于根据本地子网检查源:
Run Code Online (Sandbox Code Playgroud)# skip one-time password if logging in from the local network auth [success=1 default=ignore] pam_access.so accessfile=/etc/security/access-local.conf auth required pam_google_authenticator.so在这种情况下, access-local.conf 看起来像:
Run Code Online (Sandbox Code Playgroud)# only allow from local IP range + : ALL : 10.0.0.0/24 + : ALL : LOCAL - : ALL : ALL因此,来自 10.0.0.0/24 的登录尝试不需要两因素身份验证。
| 归档时间: |
|
| 查看次数: |
8274 次 |
| 最近记录: |