Jump to content

Networking Ubuntu...


Recommended Posts

Posted

I have a desktop running Ubuntu 6.10 and a laptop with Ubuntu 7.4.

They both work well but I would like to network them together, is there a tutorial for Linux or Ubuntu which will lead me step by step through the networking setup procedure?

Thanks,

Colin

Posted
I have a desktop running Ubuntu 6.10 and a laptop with Ubuntu 7.4.

They both work well but I would like to network them together, is there a tutorial for Linux or Ubuntu which will lead me step by step through the networking setup procedure?

Thanks,

Colin

Do you have both of your systems sharing a router? If not, you will have to use a cross-over cable to network the two to each other.

Once you physically network your systems, then it would be helpful to know what you would do with such. Richard-bkk gave some links on how to setup an NFS (network file sharing) scheme, which allows you to mount a directory or entire partition of one machine onto another, and vice versa. This has its advantages, but may be overkill for what you need.

If you want to quickly transfer files from one system to another, the easiest thing to use an SSH transfer. I can't speak about your 6.10 version, but on the 7.0.4 version (you meant that right???), go to Places -> Connect To Server and then specify the type of service (SSH) and the remote host IP address. This action will only work if the system you want to connect to has an SSH-daemon running. You can refer to the Ubuntu User's Guide on how to install that if you do not already have it.

If you proceed with the SSH approach, then you can connect to the other system and easily copy/paste files from one system to the other. I use this method to transfer files/folders from my Fedora Core 5 notebook to my Ubuntu notebook. I also use SSH when I am at the office and I want to connect to my Linux system which is connected to the WWW behind a router.

Posted

"Do you have both of your systems sharing a router? If not, you will have to use a cross-over cable to network the two to each other."

No, I do not have a router. Another member said I would need a 'crossover' cable, I asked a cable man in CM to make me one but it looks like an ordinary network cable to me. The advice was that if my network cards are smart enough, they will figure it out for themselves anyway but it doesn't work so I don't know what I have got or what I need! Said cable works OK between my ADSL modem and computer but maybe the network card really is 'smart'?

All I want to do is transfer files, and yes I do mean version 7.04, sorry, my desktop already 'sees' the NTFS Win2K Pro so just Ubuntu-to-Ubuntu is all I want.

Thank you for your assistance....

Posted
No, I do not have a router. Another member said I would need a 'crossover' cable, I asked a cable man in CM to make me one but it looks like an ordinary network cable to me. The advice was that if my network cards are smart enough, they will figure it out for themselves anyway but it doesn't work so I don't know what I have got or what I need! Said cable works OK between my ADSL modem and computer but maybe the network card really is 'smart'?

The modem (ADSL) to computer cable will be a straight through cable. You can not see any difference between a straight through and a crossover unless you look at the connectors themselves. A straight through, the colors will match pin to pin, that is 1-1, 2-2, etc. A cross-over will have two pairs that do not match pin to pin. Sounds like the tech made the wrong cable. If you had 'auto polarity sense' on your NICs (lan connection) it wouldn't matter, but looks like you don't.

To test the connection when the two ubuntu boxes are connected is to just ping one box from the other (make sure they have different IPs on each on the LAN connection).

  • 1 month later...
Posted

Another small step, I bought a 10/100 Fast Ethernet Switch in Chiang Mai, got home to discover the internet had been down for a week at home. Called TOT and after much time spent playing with my modems and computers it was declared my Ethernet Modem is kaput but luckily they could sell me another, for only 1445 baht, I simply cannot understand what went wrong, the old modem has been working perfectly for several months, I can not access the settings because I bought it second hand, I have the manual and the user/password is 'admin/admin' but that doesn't work, the TOT people suggested 'admin/tot' but no go either.

The Switch works perfectly, two computers both on the internet at the same time!!

I have not managed to get the networking going yet, how do I discover the IP address for a computer, something like 'whoamI'?

Thanks everyone for all your help,

Colin

Posted

You can obtain the IP address of a linux computer with the following command:

/sbin/ifconfig

Most linux distros designate "eth0" to be the wired connection and "eth1" to be the wireless connection. On my Ubuntu 7.04 this is the opposite.

If you want to be specific, you can run

/sbin/ifconfig eth0 or /sbin/ifconfig eth1

If it is a Windoze system, open a command (DOS) window and use 'ipconfig'.

Btw, "whoami" indicates the user-id of the user that is currently logged in.

Posted

Niloc,

I should further add that once you have determined the IP addresses assigned to your computers, that you consider pinging the other system to ensure that you can actually "see it" on the network. The command for that is:

/bin/ping IP-address

where IP-address refers to the network address of the other machine. Repeat the step on the other system, giving obviously your other system's IP address.

If all works well, consider adding entries within each system's /etc/hosts file to designate aliases for these IP addresses. Thus you would not have to remember the IP address but instead their aliases. For instance:

192.168.1.101 aliasName

Posted

Gumball, done all that and it works!! Now how do I transfer a file (or folder) from one machine to the other?

Posted

first, make sure SSH works:

host1% ssh host2

host2% ...

host2% exit

Connection to 192.168.x.x closed.

host1%

if you were able to login to host2, then you can try a file transfer with 'scp':

host1% scp local-file-1... local-file-N host2:.

this will copy the files to your home directory on host2. You can also do the reverse direction:

host1% scp host2:file1 .

this will copy the file ~/file1 on host2 into the current directory (".") on host1. You can do things like rename the files while copying them, or recursively copying directories.

See the manpage for scp for more information ("man scp"). A nicer tool is 'rsync' which uses SSH to connect to the other host, with very similar syntax as above. However, it is more powerful and can do fancier things like noticing that the other host already has a copy and skipping it. See "man rsync" for more details.

Posted

Niloc,

What 'autonomous_unit' has posted is correct. The command scp or rsync are commonly used. If you prefer to use a graphical interface for drag-n-drop, then consider setting up a server connection to your other host.

Under Ubuntu 7.04, click on Places -> Connect to Server...

- Then select SSH as the Service Type

- Enter the IP address (or alias as specified in /etc/hosts) of the remote server

- The port is optional... thus leave it blank (default for SSH is 22)

- The (base) folder is optional... thus leave it blank (default is / directory)

- Name to use for connection... leave it blank or specify a name (e.g. foo)

When you are done, click on Connect, and then enter the password used on the remote system.

I'm not sure what the procedure is under your Ubuntu 6.10 system, but it is probably something similar.

Posted

Gunball, I tried that but I was never asked for a password and although I get an icon on the desktop with the correct name, I get 'Could not open location 'ssh://colin@aliasname', access denied'.

My two computers are aliased 'Desktop' and 'Laptop'

colin@colin-desktop:~$ ssh desktop Laptop

ssh: connect to host desktop port 22: Connection refused

colin@colin-desktop:~$

whats wrong??

Posted
Gunball, I tried that but I was never asked for a password and although I get an icon on the desktop with the correct name, I get 'Could not open location 'ssh://colin@aliasname', access denied'.

My two computers are aliased 'Desktop' and 'Laptop'

colin@colin-desktop:~$ ssh desktop Laptop

ssh: connect to host desktop port 22: Connection refused

colin@colin-desktop:~$

whats wrong??

Niloc, it appears that you did not follow 'autonomous_unit's' advice about reading the man-page concerning the ssh command. No worries.

It appears from your post that you have an account on "desktop" with the name 'colin'. To connect to the other system, "laptop", the correct syntax for SSH is:

ssh laptop

Of course, if there is not a user ID of "colin" on "laptop", then the proper syntax is:

ssh -l <userID> laptop

where <userID> is an ID available on "laptop". In either case, you will be prompted for a password for the account on "laptop" (not "desktop").

Before initiating the commands above, I need to ask a simple question... does the remote system, for instance "laptop", have an SSH-daemon (server) running? If not, then you need to address this issue first. Go here to find details... Ubuntu Feisty SSH Server Installation.

Let me know if you have any further questions.

Posted

Oh JOY!! It all works!!

You were correct. I did not read the SSH bumpf but I will tomorrow. I didn't have the SSH software installed either but it all seems OK now, I did an APT-GET INSTALL on both computers is that correct? Do they now both become servers?

I have just had my electricity reconnected to another circuit so hopefully I will not lose power half a dozen times as I did today,

Thank you gentlemen, next time you are in Pai, the beer is on me!!

Posted

They do not have to both be servers, but it is helpful. Just remember that at least one must be a server.

Thus to recap, to log into the other system, use:

ssh <remote server name>

or

ssh -l <userID> <remote server name>

To transfer files or directories from one to the other:

scp <options> <source> <destination>

where <options> can include -r for recursive copying of directories (there are other options available, reference the man-page), the <source> is the file name or directory to copy, and the <destination> is the location on the system (local or remote!) where you want the file/directory to be copied.

If you prefer to use a graphical interface to transfer files/directories from one system to another, then use the steps I outlined in a previous post to set that up.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...