Page 1 of 1

SSH "ssh: Could not resolve hostname"

Posted: Sun Mar 04, 2012 8:29 am
by c-m
I seem to be flooding the forum with issues at the moment, but there a few things i need to sort on this box.

I have SSH server installed and setup. Its running on port 777.

I can connect to the server via connectbot on my android phone without issue.

When i try to connect via my laptop (mint 11) or vis the server itself (LMDE) using username@192.168.0.100:777 I receive an error

Code: Select all

ssh: Could not resolve hostname 192.168.0.100:777: Name or service not known
now if i connect using username@192.168.0.100 -p 777 it all works fine.

Why doesn't it work by specifying the port :777

Re: SSH "ssh: Could not resolve hostname"

Posted: Wed Mar 07, 2012 10:12 am
by Pilosopong Tasyo
c-m wrote:Why doesn't it work by specifying the port :777
It might be as simple as because the correct usage wasn't followed? This is what ssh throws back at me when I just type 'ssh' in the terminal window:

Code: Select all

administrator@asus-a8jn ~ $ ssh
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
administrator@asus-a8jn ~ $
As per usage instruction, you are not supposed to add the port number (and it is not an option either) after [user@]hostname unlike in the other options such as [-D [bind_address:]port] where it gives you the option to supply a port number.

Just use [-p port] as per correct usage then.

Re: SSH "ssh: Could not resolve hostname"

Posted: Wed Mar 07, 2012 10:47 am
by c-m
ssh user@ip:port

e.g me@127.0.0.1:22

Is correct usage, or am i very much mistaken. I've done that on other machines, and it seems to be in common use around the web.

Re: SSH "ssh: Could not resolve hostname"

Posted: Wed Mar 07, 2012 4:41 pm
by fiver22
I've always done ssh -p someport someusername@someserver

Re: SSH "ssh: Could not resolve hostname"

Posted: Thu Mar 08, 2012 12:07 am
by Pilosopong Tasyo
c-m wrote:...and it seems to be in common use around the web.
Well, it's a perception. But just because it's common throughout the web doesn't necessarily mean everyone should follow suit. Apparently, ssh has its own standard as far as usage is concerned.

Re: SSH "ssh: Could not resolve hostname"

Posted: Thu Mar 08, 2012 4:31 am
by c-m
Ok but the problem is that NXserver will not connect when I change the port in both the ssh config and nxserver config. Which is odd as FreeNX never had a problem under the ubuntu edition.