Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-25-2004, 03:00 AM   #1
Registered: Sep 2003
Location: Bangladesh
Distribution: Debian
Posts: 102

Rep: Reputation: 15
can't ssh through hostname

I have two PC. they are pc1 pc2

both PC are running win98 and redhat 9

from pc1 ( win98 ).......I cannot ssh to pc2 by typing "ssh pc2"

but if I write ssh it's alright....

pls help...
Old 07-25-2004, 03:12 AM   #2
LQ Newbie
Registered: Jun 2003
Location: Kuwait
Distribution: AIX,p690,SUN,SGI,RedHat7.3
Posts: 12

Rep: Reputation: 0
coz your win98 Pc will not recognise your linux pc name in dns entry or hosts file.
add IP/name entry in pc dns/hosts file.
Old 07-25-2004, 04:11 AM   #3
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
Yes, just to expand on the above post, when you type

ssh PC2

from your Win98 box, it will try and look up the IP address of "PC2" from your DNS server. Obviously, a DNS server will not have an entry for PC2.

Therefore, you have to modify the hosts file on the Win98 box, (use Google to find out where the file is, I believe it is just called "hosts") and add an entry following the example they give.
Old 07-25-2004, 07:00 AM   #4
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
You could also run your own internal DNS server, or if you are running samba, you can enable the WINS server option to help with this type of name resolution.


Old 07-25-2004, 01:54 PM   #5
Registered: Sep 2003
Location: Bangladesh
Distribution: Debian
Posts: 102

Original Poster
Rep: Reputation: 15
my hosts file is as follows :

# Copyright (c) 1998 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP stack for Windows98
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# # source server
# # x client host

# localhost pc1 pc2 pc3 pc4

but I cannot ssh through hostname


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
Running a shell script remotely via 'ssh <hostname> <command>' davee Linux - General 4 10-09-2005 01:38 AM
Cannot SSH/FTP by hostname, but ip works joshtt Linux - Networking 3 09-20-2005 05:08 AM
can ssh by IP, can't by hostname. FLOODS Linux - Networking 7 09-19-2005 01:41 PM
Ping or SSh by hostname ElectroLinux Linux - Newbie 2 10-26-2004 03:21 AM
Do after changed the hostname, can't connection by SSH again? explorer1979 Linux - Networking 2 03-30-2004 10:15 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:45 PM.

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