I wanted to start SSH server on Ubuntu 14.04 running on VirtualBox. I installed Openssh, sshd, etc., configured sshd_config to listen on IP, which I see in ifconfig and it is not working. I am starting sshd on port 2222. nmap <my-ip> gives:

PORT        STATE        SERVICE
80/tcp        open        http
2222/tcp        open        EtherNet/IP-1
8080/tcp        open        http-proxy

HTTP server started at 8080 works fine, so why sshd service is not recognized? When I try to log in by ssh as a client I see "Could not resolve hostname : Name or service not known".

  • Just to be sure. Do you provide the -p 2222 to the ssh command? Also what does lsof :i 2222 say. – Valentin Bajrami Aug 6 '14 at 9:17

what command are you using ?

ssh -p 2222 foobar

The error message you mention say that you do not resolv foobar. have you tried using IP ?


ssh -p 2222

Additionally, if you want nmapto show what's actually running instead of resolving well-known ports to protocols, you can use the -sV option.

-sV: Probe open ports to determine service/version info
  • @val0x00ff: thanks! What a stupid mistake, I used ssh <ip>:<port> instead "-p <port". – trivelt Aug 6 '14 at 9:29
  • @trivelt I'm starting to develop some supernatural abilities. Glad it worked for you. – Valentin Bajrami Aug 6 '14 at 10:00

ssh isn't listed in your nmap output as nmap prints the well known service that uses the port it's found. Port 2222 is normally used by the EthernetIP service which is used in industrial control.

The error message states Could not resolve hostname. This means it can't find the server by name. Try connecting using it's IP address instead, or alternatively, fix your name resolution using either DNS or adding the server to the file /etc/hosts on the client. If your client is Windows, I believe the file is C:\Windows\system32\drivers\etc\hosts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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