我当前的sshd PAMconfiguration:
#%PAM-1.0 auth include system-auth account required pam_nologin.so account include system-auth password include system-auth session optional pam_keyinit.so force revoke session include system-auth session required pam_loginuid.so
我正在添加Google Authenticator,但是我们还没有准备好将其推广给所有用户。
我相信以下内容应该要求Google Authenticator PAM为“gauth”组中的用户提供服务,但是希望有人在我将自己locking在SSH之前检查我的工作。
#%PAM-1.0 auth include system-auth account required pam_nologin.so account include system-auth password include system-auth auth [success=1 default=ignore] pam_succeed_if.so quiet user notingroup gauth auth required pam_google_authenticator.so session optional pam_keyinit.so force revoke session include system-auth session required pam_loginuid.so
我是否正确理解“成功= 1”是指“如果成功则跳过下一行”?
我相信你的理解是正确的,基于帕姆文件 。
如果需要打开另一个连接进行testing,您应该能够进行更改,testing和还原,并保留原来的ssh会话连接(但请确保它不超时)。
当玩弄PAM堆栈时,我通常不使用服务,我实际上想要修改,因为这是一个“生产性”的服务。
所以在这种情况下,我会用/etc/pam.d/login而不是ssh来testing。 login可以通过简单地调用:
login
如果PAMconfiguration看起来不错,我可以将其转移到gdm , ssh或其他。 (谁需要本地login;-)
是的, 成功= n意味着,在成功的情况下,跳过接下来的n行。