Monday, April 12, 2010

How to communicate between two ubuntu systems using a Ethernet cable

At first connect the two systems using a Ethernet cable.

To setup ip addresses from console is not very hard. Here is what I would do:

You can set ip address with ifconfig command. That kind of setting will not be remembered after you reboot, but will be enough to set up local network between two computers for transfering files (that is what I do when I need to transfer files from my laptop to my home computer). On your laptop you should type (in console):

ifconfig eth0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255

And on your home computer:

ifconfig eth0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255

Two computers are now on the same network and can talk to each other. At this point I usually start ssh daemon on one of the computers. On suse you can start it from yast, and on ubuntu you may type (as root):

/etc/init.d/ssh start (or sudo /etc/init.d/ssh start)

Now you can connect to that machine via ssh, by typing:

ssh 10.0.1.1 (or 10.0.1.2)

or copy files with scp command, for example:

scp username@10.0.1.1:/home/username/Desktop/*.mp3 .

will copy all mp3 files from your Desktop folder on 10.0.1.1 machine to 10.0.1.2

No comments:

Post a Comment