Tell me more ×
IT Security Stack Exchange is a question and answer site for IT security professionals. It's 100% free, no registration required.

I don't know if this is even possible... I have a single static IP and 3 servers connected to the router. 1 server is Ubuntu Linux with an SSH server. 6 or 8 domain names are linked to my 1 static IP. What I am hoping to achieve is for Linux only to accept an SSH connection if a certain name is used.

Is this going to require a DNS server on this side of my firewall? Or is this even possible.

Thanks in advance for any advice.

share|improve this question
You can filter incoming connection based on IP numbers. You dont need DNS server as you can use just the static ip number of your server to connect to, and on your firewall, the ip number of the client to connect from, so on the firewall you allow only the client ip address to connect to your ssh server:-) – Andrew Smith Aug 2 '12 at 22:00
I feel like maybe my question isn't clear. Example: I have 2 registered domain names (acme.com, ajax.com). Both of these name resolve to my single static IP. My router routes port 22 (SSH) to the Linux server (192.168.1.21). I would like for ajax.com to be the url for SSH while blocking acme.com on that port. – aserwin Aug 2 '12 at 22:06
serverfault.com/questions/329529/virtual-hosts-for-ssh this is interesting, and it involves sshd in the middle, so baybe sshd can do the check if the remote host / user is OK – Andrew Smith Aug 2 '12 at 23:29
Why exactly are you trying to achieve this? SSH is usually used for remote administration of a machine. Accessing SSH through a domain name doesn't make any sense to me. – Terry Chia Aug 3 '12 at 6:25
Hi @aserwin - welcome to IT Security. This was already asked (and answered) on Server Fault. Please do not cross-post. – AviD Aug 3 '12 at 8:22

closed as off topic by AviD Aug 3 '12 at 8:21

Questions on IT Security Stack Exchange are expected to relate to IT security within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

What do you mean with name? DNS name?

SSH is not aware of the DNS protocol. So you can not accept an IP is domainname example.com is used and deny if example.org is used.

share|improve this answer
I know SSH itself isn't aware of the name.. But I am curious about the operating system. If aaa.com and bbb.com both resolve to 192.168.1.21 is there a way that once the traffic is at .21 Linux will can check the request and only accept it (and move it on to SSH) if the request is aaa.com. So, even though bbb.com resolves to the same IP, it can't be used to access the SSH server. – aserwin Aug 2 '12 at 21:52
The DNS resolution is done on the client side. No information about which domain name the client is using is transferred across. In HTTP, the client explicitly states which server it wants after connecting. In SSH, there's no such feature. – Polynomial Aug 3 '12 at 7:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.