LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2003, 01:29 AM   #1
hagbardc
LQ Newbie
 
Registered: Apr 2003
Posts: 9

Rep: Reputation: 0
ssh'ing to hostname


I just set up a second computer in my LAN with Mandrake, and now I want to ssh between the two machines. ssh'ing to the internal ip adress (192.168.1.xxx) is working fine, but I want to just be able to ssh hostname1 . Any help on how to do that?

Thanks very much
 
Old 06-21-2003, 01:49 AM   #2
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
On each machine, you need to add an entry to the /etc/hosts file, stating the IP address and hostname of the other machine.

For example, if you have one box with hostname machine1, which has IP 192.168.1.1; and a second box with hostname machine2 and IP 192.168.1.2; then you need to add:

192.168.1.2 machine2

to the /etc/hosts file on machine1, and add:

192.168.1.1 machine1

to the /etc/hosts file on machine1.


Enjoy!

-- Cerbere
 
Old 06-21-2003, 01:50 AM   #3
footfrisbee
Member
 
Registered: Apr 2003
Distribution: Debian Sarge
Posts: 259

Rep: Reputation: 30
Add the second computer to your /etc/hosts file. Just add

192.168.1.xxx hostname1.local.net hostname1

and you'll be in business.
 
Old 06-21-2003, 01:50 AM   #4
footfrisbee
Member
 
Registered: Apr 2003
Distribution: Debian Sarge
Posts: 259

Rep: Reputation: 30
Woops, I wasn't fast enough!
 
Old 06-21-2003, 10:20 AM   #5
hagbardc
LQ Newbie
 
Registered: Apr 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Great - that worked. Thanks a lot, guys!
 
  


Reply



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'ing between two computers through a router kz26 Linux - Networking 6 08-14-2005 11:09 PM
hostname terx005 Linux - Newbie 4 03-25-2004 03:19 AM
Receiving an MITM warning when ssh'ing gonzalezjay Linux - Security 1 10-17-2003 05:00 AM
Hostname? dancemutha Linux - General 12 03-18-2003 10:29 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:57 AM.

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