LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH Troubles: ssh: Could not resolve hostname: Name or service not known -Xubuntu12 (https://www.linuxquestions.org/questions/linux-networking-3/ssh-troubles-ssh-could-not-resolve-hostname-name-or-service-not-known-xubuntu12-948225/)

reklaimer 06-02-2012 08:24 PM

SSH Troubles: ssh: Could not resolve hostname: Name or service not known -Xubuntu12
 
So, i have an Ubuntu 10.10 Server on my home network running openssh. I am able to ssh into it via my work's PC running putty and i can also ssh into it on my Windows 7 machine here at home. I have a laptop dual booted with Windows 7 and Xubuntu 12.04 When i try to ssh into my server i get the message:

Could not resolve hostname 10.1.2.150:14747: Name or service not known.

I have changed the default port on the open ssh config to 14747.

So, I've installed putty on my Xubuntu laptop, and it connects fine to my server. Why would it not allow me to connect to it using the terminal?

These are the ways i've tried to ssh:

ssh 10.1.2.150:14747 -l (username)

and

ssh (username)@(hostname)

ssh (username)@(ipaddress)

Is this an issue anyone has experienced with Xubuntu? Am i doing something wrong? Any thoughts would be greatly appreciated.

fogpipe 06-02-2012 08:59 PM

Are you sure that sshd is listening on that port?
Whats the output of
Code:

netstat -pant
on your server? that should tell you what ports sshd is listening on.

Actually i just found out from another post that "netstat -ltn" might work even better to see where sshd is listening :)
Sorry thats -ltn not -lta, you need the n to get the actual port numbers.

reklaimer 06-02-2012 10:59 PM

Sorry, i forgot i changed my default SSH port to 18287 instead of 14747.


reklaimer@watson:~$ netstat -ltn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 10.1.2.150:5001 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:18287 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:7634 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:61558 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:19000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:15232 0.0.0.0:* LISTEN
tcp6 0 0 :::9412 :::* LISTEN
tcp6 0 0 :::39944 :::* LISTEN
tcp6 0 0 :::4040 :::* LISTEN
tcp6 0 0 :::18287 :::* LISTEN
tcp6 0 0 :::61558 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 :::15232 :::* LISTEN

amilo 06-03-2012 02:32 AM

ssh user@host -p 18287

Read man ssh

reklaimer 06-03-2012 02:53 AM

Thanks amilo that did it! For whatever reason, i never realized that -p was for port. I became custom to one way of sshing (via default port) so i never had to use it before. All of my other installs of linux never gave me this kind of trouble when using my normal method. Thanks again.


All times are GMT -5. The time now is 03:13 AM.