SSH "ssh: Could not resolve hostname"

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read this

SSH "ssh: Could not resolve hostname"

Postby c-m on Sun Mar 04, 2012 8:29 am

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
c-m
Level 3
Level 3
 
Posts: 114
Joined: Mon Aug 24, 2009 2:01 pm

Linux Mint is funded by ads and donations.
 

Re: SSH "ssh: Could not resolve hostname"

Postby Pilosopong Tasyo on Wed Mar 07, 2012 10:12 am

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.
Image
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].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1205
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: SSH "ssh: Could not resolve hostname"

Postby c-m on Wed Mar 07, 2012 10:47 am

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.
c-m
Level 3
Level 3
 
Posts: 114
Joined: Mon Aug 24, 2009 2:01 pm

Re: SSH "ssh: Could not resolve hostname"

Postby fiver22 on Wed Mar 07, 2012 4:41 pm

I've always done ssh -p someport someusername@someserver
User avatar
fiver22
Level 1
Level 1
 
Posts: 46
Joined: Wed Feb 01, 2012 8:08 am

Re: SSH "ssh: Could not resolve hostname"

Postby Pilosopong Tasyo on Thu Mar 08, 2012 12:07 am

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.
Image
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].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1205
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: SSH "ssh: Could not resolve hostname"

Postby c-m on Thu Mar 08, 2012 4:31 am

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.
c-m
Level 3
Level 3
 
Posts: 114
Joined: Mon Aug 24, 2009 2:01 pm


Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 1 guest