SSH "ssh: Could not resolve hostname"

Archived topics about LMDE 1 and LMDE 2
Locked
c-m

SSH "ssh: Could not resolve hostname"

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: SSH "ssh: Could not resolve hostname"

Post 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.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
c-m

Re: SSH "ssh: Could not resolve hostname"

Post 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.
User avatar
fiver22
Level 1
Level 1
Posts: 46
Joined: Wed Feb 01, 2012 8:08 am

Re: SSH "ssh: Could not resolve hostname"

Post by fiver22 »

I've always done ssh -p someport someusername@someserver
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: SSH "ssh: Could not resolve hostname"

Post 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.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
c-m

Re: SSH "ssh: Could not resolve hostname"

Post 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.
Locked

Return to “LMDE Archive”