sshd configuration with match and 2 record
Hi All,
I have a issue with hostname and ssh resolver. I'm config ssh match with Address. but the a target server has 2 A Record, And he always checks only one. getent hosts 172.16.50.1 172.16.50.1 bb.lian.co.il cc.lian.co.il Feb 2 05:17:46 zabbix-agentless sshd[2126348]: debug1: PAM: initializing for "root" Feb 2 05:17:46 zabbix-agentless sshd[2126348]: debug1: PAM: setting PAM_RHOST to "bb.lian.co.il" |
If you have a question, please formulate it. It's not quite clear to me what you want.
|
I'll try to explain.
When I'm configure sshd service with section of match. Example. Match host aaaa.domain.com Rootlogin yes But to an aaaa host has 2 record. so the ssh always get only one, and I want to use the second record |
I would try
Code:
match host 172.16.50.1 Code:
match host bb.lian.co.il cc.lian.co.il |
Thanks for reply.
It's was only example, of course I used this syntax. that is not the question BTW if you want to use with ip the code is match address, there is a different ;) |
You could try the following:
Code:
Match Address 192.168.1.100 But that would allow anyone connecting to that IP to login as root. Root login is a bad idea and you really shouldn't allow it. Make everyone log in with their user account and then switch to root using either 'su -' or 'sudo'. |
^ Agreed.
I'm confused by the conflagration of DNS and SSH here. I understand the connection and issue now, but these are two separate things and should be considered separately. Quote:
Or use cc.lian.co.il instead of the numerical IP in your sshd_config? |
Because I want to use in cname record,
And not with hostname of computer. |
So if I understand correctly, you have several names that resolve in DNS to the same IP address, but you would like only one of the names to be acknowledged by the SSH server?
Code:
Match Address nametwo.example.com Code:
AllowUsers avner@nametwo.example.com Don't lock yourself out during the testing, though. Be sure to have another means of accessing the system while you adjust the configuration file. |
All times are GMT -5. The time now is 08:33 PM. |