I have a Linux server running SSHD and would like to know if its possible to configure it, such that from within the LAN you only need a RSA key to authenticate (on port X), but from outside the LAN the user would need to authenticate with both a RSA key and an OTP password generated by a PAM module (via port Y)?
I tried configuring /etc/ssh/sshd_config with the match condition:
match user XX
LocalPort 22
PasswordAuthentication no
RSAAuthentication yes
match user XX
LocalPort 12345
PasswordAuthentication yes
RSAAuthentication no
It gives me the error: bad parameter
implying that this command isn't supported, although in the sshd_config manual it says that it is.
In summary, my question is: Is it possible to have different authentication methods for the same user depending on which port they SSH into?
LocalPort
? It's pretty new.ssh -v
command, it said that ssh 6.0 was installed. From what I read in the manual, it is supposed to be supported. If it isn't supported, is there a way of adding this function?