LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-04-2009, 06:09 PM   #1
pmw
LQ Newbie
 
Registered: Nov 2004
Distribution: Fedora 12
Posts: 16

Rep: Reputation: 0
How to ssh between two machines on a "home network"


Hello,

This is probably a straightforward problem, but I can't seem to find a solution which addresses my problem exactly.

I have a normal home broadband connection, with a wireless router and a dynamic IP address. Nothing fancy at all. I have two machines, a Linux box (Fedora 12) and a Windows (Vista) machine; the Linux box is connected to the router via ethernet cable, and the Windows machine wirelessly.

My question is, how can I easily (and permanently) ssh and scp between the two machines since I don't know their IP addresses from one day to the next? Both machines have hostnames... can I somehow set up an alias so that each computer knows how to talk to the other?

Thanks for your advice.
 
Old 12-04-2009, 06:51 PM   #2
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1
Posts: 4,848

Rep: Reputation: 431Reputation: 431Reputation: 431Reputation: 431Reputation: 431
The easy way is to assign static IP address to each machine. They can be any IP address in the range of your sub-net not used by the DHCP server in the router.

You need to know how to connect to your router and how to configure it. Usually form a web browser type 192.168.x.1 where x is the number of your sub-net. Once connected, look for the range of addresses the DHCP server can give out. Usually you can control this number. On my router, I set it for 4 addresses only. I have 3 systems using DHCP, so that leaves one spare address.

The other way is to determine the MAC addresses of the cards in each system. That is easy in linux, from the command line issue as root the command 'ifconfig eth0' ( without the quotes, assuming it is eth0 ). That will dump some information on the screen, the MAC address is in there. Here is what it will look like.

Quote:
/sbin/ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:1D:7D:20:F4:67
inet addr:192.168.1.26 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:628129 errors:0 dropped:0 overruns:0 frame:0
TX packets:589113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:301913696 (287.9 MiB) TX bytes:94797228 (90.4 MiB)
Interrupt:24 Base address:0x6000
The field HWaddr is the MAC address. Most routers allow you to specify a MAC address, and what IP address to issue to that card. Then you know what IP it will always get.

I think if you look in the networking section in windbloze you can find the MAC address also.

If you need more help with connecting to the router, post the make and model. Most of them have documentation online we can search to find out the details....
 
Old 12-04-2009, 06:56 PM   #3
code933k
Member
 
Registered: Aug 2007
Location: Bogotá, Colombia. South America
Distribution: ArchLinux / Source Mage GNU Linux (test branch) / openSUSE
Posts: 130

Rep: Reputation: Disabled
If you can ping them by their names i.e., Your router has a decent and configured name-server, then you can. For most of us, static IPs is not an option but calling machines by their names surely is.

Last edited by code933k; 12-04-2009 at 06:57 PM.
 
Old 12-05-2009, 04:56 AM   #4
pmw
LQ Newbie
 
Registered: Nov 2004
Distribution: Fedora 12
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks to both of you. I hadn't thought about configuring the router itself, so I did that, and am now at the stage where each machine has a static IP, and I can ping the Linux machine from the Windows machine.

However, my pings from the Linux machine to the Windows machine get lost, and I can't ssh between the two machines either way. Do you have any more advice? Is it something to do with firewalls on either machine and/or the router?

Thanks.

Last edited by pmw; 12-05-2009 at 05:28 AM. Reason: Improved English
 
Old 12-05-2009, 05:42 AM   #5
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1
Posts: 4,848

Rep: Reputation: 431Reputation: 431Reputation: 431Reputation: 431Reputation: 431
I do not think the router is the problem now. Firewall(s) are probably the best bet. They can filter both transmitted and received packets.

SSH runs on port 22 by default. You can look at /etc/ssh/ssh_config file to see if the default port is in use, or has been changed. If the is a firewall, then open port 22 and give it a try. You could just disable the firewall for a test to see if that is the problem.

Another possibility on the linux side is the /etc/hosts.deny and /etc/hosts.allow files. Have a look to see if they are there. If not, then that isn't the problem. If they are, and you have a line in hosts.deny file, with
Quote:
ALL:ALL
in it, then you need a line in hosts.allow like this,

Quote:
sshd sshd1 sshd2 : 192.168.1.20 , 192.168.1.21
This is a list of allowed IP's allowed to ssh into the server.
 
  


Reply

Tags
home, linux, network, windows


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 issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 02:35 PM
[SOLVED] how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist platinumedge Linux - Newbie 4 10-04-2009 06:28 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
"network is unreachable" but I can ping local machines MrGaiters Linux - Newbie 3 03-24-2006 02:38 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration