LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   can't ssh through hostname (http://www.linuxquestions.org/questions/linux-networking-3/cant-ssh-through-hostname-209364/)

romel 07-25-2004 03:00 AM

can't ssh through hostname
 
I have two PC. they are

202.84.35.225 pc1.dns1.com pc1
202.84.35.224 pc2.dns2.com 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 202.84.35.224....then it's alright....

pls help...

rudy3107 07-25-2004 03:12 AM

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.

SBing 07-25-2004 04:11 AM

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.

charon79m 07-25-2004 07:00 AM

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.

Cheers,

MrKnisely

romel 07-25-2004 01:54 PM

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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# 127.0.0.1 localhost

202.84.35.225 pc1 pc1.dns1.com
202.84.35.224 pc2 pc2.dns2.com
202.84.35.223 pc3 pc3.dns3.com
202.84.35.222 pc4 pc4.dns4.com

but I cannot ssh through hostname


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