MSK61
2008-08-21, 02:56 PM CDT
I'm using fedora 9 x86_64 edition, with openssh 5.0p1(the latest version available in fedora repositories. In the server configuration file /etc/ssh/sshd_config, I appended the following line:
AllowUsers user1@host1
Where user1 is one of the user accounts on my F9 box and host1 is a computer on my LAN. I configured my F9 box to be a wins server(with the aid of samba), updated my /etc/nsswitch.conf file accordingly to use wins as one means of resolving names. I can ping host1 from my F9 box, which proves the name resolution works correctly as expected.
However sshd seems not to use wins(even if it's mentioned in /etc/nsswitch.conf as means to resolve name) to resolve the hostname host1. If I try to access my F9 box from host1, I get an access denied message. However if I substitute the IP address for host1 in /etc/ssh/sshd_config, sshd recognizes the host effectively and allows me to connect to my F9 box from host1.
I've made another trail, by disabling the wins server(just for the simplicity of my trial) and hard binding host1 with an IP address in /etc/hosts(; for this trial also I gave host1 a static IP). Then I noticed some strange behaviour:
If I write the host specification in /etc/hosts on the form:
<IP address> host1 <other alias names>
sshd recognizes the hostname correctly and allows the connection accordingly.
On the other hand, if I write the host specification on the form:
<IP address> <list of alias hostnames> host1 [another list of alias hostnames]
sshd can't recognize the hostname and hence prevents the connection.
This means that host1 must be the first name directly following the IP address; if it's preceded by any other hostname, it's discarded. i.e. sshd only recognizes the first host name in the list of aliases an IP address may have.
I played with the UseDNS option in the /etc/ssh/sshd_config file by toggling it through yes and no; in both cases I had the same behaviour.
I don't know exactly but I think, if I man't missing anything, that this may be a wrong behaviour for sshd to resolve names. It seems it doesn't follow the means specified in /etc/nsswitch.conf. Moreover it can't resolve all hostnames(specifically aliases) from the /etc/hosts file.
So before I file a bug about openssh, I need to know if I'm missing anything, or if anyone else has encountered the same behaviour.
Thanks for your cooperation.
AllowUsers user1@host1
Where user1 is one of the user accounts on my F9 box and host1 is a computer on my LAN. I configured my F9 box to be a wins server(with the aid of samba), updated my /etc/nsswitch.conf file accordingly to use wins as one means of resolving names. I can ping host1 from my F9 box, which proves the name resolution works correctly as expected.
However sshd seems not to use wins(even if it's mentioned in /etc/nsswitch.conf as means to resolve name) to resolve the hostname host1. If I try to access my F9 box from host1, I get an access denied message. However if I substitute the IP address for host1 in /etc/ssh/sshd_config, sshd recognizes the host effectively and allows me to connect to my F9 box from host1.
I've made another trail, by disabling the wins server(just for the simplicity of my trial) and hard binding host1 with an IP address in /etc/hosts(; for this trial also I gave host1 a static IP). Then I noticed some strange behaviour:
If I write the host specification in /etc/hosts on the form:
<IP address> host1 <other alias names>
sshd recognizes the hostname correctly and allows the connection accordingly.
On the other hand, if I write the host specification on the form:
<IP address> <list of alias hostnames> host1 [another list of alias hostnames]
sshd can't recognize the hostname and hence prevents the connection.
This means that host1 must be the first name directly following the IP address; if it's preceded by any other hostname, it's discarded. i.e. sshd only recognizes the first host name in the list of aliases an IP address may have.
I played with the UseDNS option in the /etc/ssh/sshd_config file by toggling it through yes and no; in both cases I had the same behaviour.
I don't know exactly but I think, if I man't missing anything, that this may be a wrong behaviour for sshd to resolve names. It seems it doesn't follow the means specified in /etc/nsswitch.conf. Moreover it can't resolve all hostnames(specifically aliases) from the /etc/hosts file.
So before I file a bug about openssh, I need to know if I'm missing anything, or if anyone else has encountered the same behaviour.
Thanks for your cooperation.