我有一个小型的服务器,我希望能够使用SSHlogin2种方法:
我成功安装了libpam-python ,并将这一行添加到/etc/pam.d/sshd :
auth requisite /lib/x86_64-linux-gnu/security/pam_python.so /lib/x86_64-linux-gnu/security/my_pam.py
举个例子,假设我的python pam正常工作,只是要求input另一个密码。
以下是我的/etc/ssh/sshd_config中的相关参数:
# PAM UsePAM yes ChallengeResponseAuthentication yes # Regular password PasswordAuthentication yes PermitEmptyPasswords no # Authentication Methods # Either an authorised public key, or the password + another one (python pam). AuthenticationMethods publickey password,keyboard-interactive:pam
不幸的是,这不起作用:
# I am not using an authorized public key me@client:~$ ssh user@myserver user@myserver's password: Permission denied, please try again. user@myserver's password: Permission denied, please try again. user@myserver's password: Permission denied (publickey,password).
我的密码是正确的! 如果我将参数更改回其默认值,我的密码被识别,我可以login!
这个问题似乎是AuthenticationMethods参数。 如果我删除它,它的作品:
me@client:~$ ssh user@myserver Python PAM password: Password OK! END OF PYTHON PAM. Password: user@myserver:~$
请注意,经典的user@myserver's password:已被stern Password:所取代。
不幸的是,即使它工作,我也不能select2种方法的顺序(我想要相反的顺序),经典的密码方法似乎已经被一个我不知道的PAM版本取代,因此麻烦我有点。
我该如何解决这个问题?