我的目标是在从本地网络外部连接时实现 2FA(密码 + OTP)SSH 登录,而从本地网络(192.168.1.0/24)使用“仅密码”SSH 登录。
目前,我有第一位(密码+OTP)并使用以下配置:
我的/etc/ssh/sshd_config
:
KbdInteractiveAuthentication yes
UsePAM yes
我的/etc/pam.d/sshd
:
#@include common-auth
auth required pam_unix.so nullok_secure
auth required pam_oath.so usersfile=/etc/users.oath window=30 digits=6
如何从本地网络获取第二位(仅密码,无 OTP)?
提前致谢!