LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2009, 11:10 AM   #1
jqweezy
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Rep: Reputation: 0
SSH Problem - Can't login using Hostname, can login using ip address


Hello All,

I am having a problem logging into my remote gentoo (2.6.23) linux machine using my hostname from my Windows XP machine using cygwin. I can login using my ip address, but not the hostname.

This works:
$ ssh me@xxx.xxx.xx.xxx

This does NOT work:
$ ssh me@my_hostname
ssh: connect to host my_hostname port 22: Connection refused

I have verified that my hostname is indeed "my_hostname" on my linux machine by using the "hostname" command. Any ideas on what my problem could be? I look foward to any feedback you may have.

Regards,
JQ
 
Old 01-26-2009, 11:40 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
It doesn't matter what your hostname is set to on the server. It does matter how the name gets resolved from the client.

So, from the client side (Windows?), post the results of: nslookup your_hostname

If it's not resolving to the correct IP address, there is your issue.
 
Old 01-26-2009, 12:50 PM   #3
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
Your server has to have a fully qualified name before it is going to be accessible only by a name if you are outside your own subnet.
 
Old 01-26-2009, 12:57 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
you can add it in the hosts file
xxx.xxx.xxx.xxx domain.com
 
Old 01-26-2009, 01:26 PM   #5
jqweezy
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for your reply. Your right, I get Non-existent domain when I do an nslookup my_hostname.

Quote:
If it's not resolving to the correct IP address, there is your issue.
How would i go about resolving to the correct IP?

Quote:
Your server has to have a fully qualified name before it is going to be accessible only by a name if you are outside your own subnet.
I am on the same subnet.

Regards,
JQ

Last edited by jqweezy; 01-26-2009 at 01:29 PM.
 
Old 01-26-2009, 01:32 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
How would i go about resolving to the correct IP?

get a real domain name with DNS entries
or
Add it in the hosts file
xxx.xxx.xxx.xxx domain.com
 
Old 01-26-2009, 01:39 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
@jqweezy: The wikipedia hosts file article describes where to find this on Windows systems.

That would probably be the way to go, unless you've registered this hostname/IP address with DNS already. (Or intend to do so.)
 
Old 01-26-2009, 02:21 PM   #8
jqweezy
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Lightbulb

Thanks alot guys, adding it to my hosts file worked. Thanks anomie, repo, and pentode for your responses.

Regards,
JQ
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh login using hostname linuxguy08 Linux - Server 4 05-01-2008 08:03 PM
How do I ssh using a hostname instead of using an IP address? gdlinuxer Linux - Wireless Networking 3 01-21-2007 02:26 AM
SSH login problem thomas_fogh Linux - Networking 2 03-22-2006 12:42 PM
Another ssh login problem silver2003 Linux - Security 3 10-03-2004 08:44 AM
ssh login problem K_M_McMahon Linux - Newbie 4 03-29-2004 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration