Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-26-2009, 11:10 AM
|
#1
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Rep:
|
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
|
|
|
01-26-2009, 11:40 AM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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.
|
|
|
01-26-2009, 12:50 PM
|
#3
|
Member
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488
Rep:
|
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.
|
|
|
01-26-2009, 12:57 PM
|
#4
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
you can add it in the hosts file
xxx.xxx.xxx.xxx domain.com
|
|
|
01-26-2009, 01:26 PM
|
#5
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
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.
|
|
|
01-26-2009, 01:32 PM
|
#6
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
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
|
|
|
01-26-2009, 01:39 PM
|
#7
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
@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.)
|
|
|
01-26-2009, 02:21 PM
|
#8
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
Thanks alot guys, adding it to my hosts file worked. Thanks anomie, repo, and pentode for your responses.
Regards,
JQ
|
|
|
All times are GMT -5. The time now is 01:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|