我有一个运行 SSHD 的 Linux 服务器,想知道是否可以对其进行配置,这样在 LAN 内您只需要一个 RSA 密钥来进行身份验证(在端口 X 上),但从 LAN 外部用户需要进行身份验证使用 PAM 模块(通过端口 Y)生成的 RSA 密钥和 OTP 密码?
我尝试使用匹配条件配置 /etc/ssh/sshd_config :
match user XX
LocalPort 22
PasswordAuthentication no
RSAAuthentication yes
match user XX
LocalPort 12345
PasswordAuthentication yes
RSAAuthentication no
它给了我错误:bad parameter
暗示不支持此命令,尽管在 sshd_config 手册中它说它是。
总之,我的问题是:是否可以根据他们 SSH 进入的端口为同一用户提供不同的身份验证方法?