Key based ssh authentication with host restriction not working on RHEL 4
Issue
We have a user that is not set up with a password but authorized_keys. In the key, we specify multiple ips since this user could come from multiple servers all with the same key. The key works just fine on AS 3 and Rhel 5 but on AS 4, if I do not put the hostname in instead of the ip I get this in my secure log:
Nov 19 15:03:11 server sshd[2204]: Authentication tried for user with correct key but not from a permitted host (host=server2
.example.com, ip=::ffff:10.7.224.65).
Nov 19 15:03:11 server sshd[2204]: Failed password for user from ::ffff:10.7.224.65 port 55480 ssh2
Nov 19 15:03:11 server sshd[2204]: Failed password for user from ::ffff:10.7.224.65 port 55480 ssh2
Nov 19 15:03:11 server sshd[2205]: Connection closed by ::ffff:10.7.224.65
Here is what the authorized_keys file looks like
[root@server .ssh]# more otherkeys
from="10.2.224.65,10.2.224.66,10.2.224.67,10.2.224.68,10.2.224.69,10.2.224.7?,10.2.224.8?,10.2.224.9?,10.2.224.10?,10.2.224.11?,10.2
.224.120,10.2.224.121,10.2.224.122,10.2.224.123,10.2.224.124,10.2.224.125,10.2.224.126,10.7.224.65,10.7.224.66,10.7.224.67,10.7.224.
68,10.7.224.69,10.7.224.7?,10.7.224.8?,10.7.224.9?,10.7.224.10?,10.7.224.11?,10.7.224.120,10.7.224.121,10.7.224.122,10.7.224.123,10.
7.224.124,10.7.224.125,10.7.224.126" ssh-rsa KEYREMOVED== keyname@host
Environment
- Red Hat Enterprise Linux (RHEL) 4.8
- sshd running****
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.