Ubuntu – Safe Home Network through WiFi

networking

Maybe this is such an obvious question that it's a duplicate.

I have Ubuntu 10.10 on both my PC and Laptop. The Laptop connects to the Internet through a WiFi router. The PC connects to the same router with an Ethernet cable.

How can I safely share files between my PC and Laptop through this router? Do I have to change the router's config?

I'll need SSL as the WiFi is open at this moment, but I guess I can find info about that without a problem. Once I've done that, network printing should be easy 🙂

Edit Updated both to 11.10. Activated DHCP on the router to fix the IP addresses of both computers and the router now uses WPA2. I haven't been able to set up NFS between the computers, but I did achieve a safe FTP server connection.

Best Answer

On each computer install the ssh package.

Then you can mount the filesystem over SFTP (stands for Ssh File Transfer Protocol) in nautilus and copy that way just like you would between drives. To access files on the other computer, open nautilus and Clik the File -> Connect to server... menu. Pick ssh from the menu/list. Put in your username for the other computer and the IP for the other computer and click connect. It should ask for your password for the laptop username you put in and then it should show the files on the laptop. (You can do this in either direction.)

This method encrypts the whole thing both ways so it is safe even over open wifi (or if you use strong passwords) even over the internet. You can find out the IP of a computer by running ifconfig on it. It will give you something like this:

eth0      Link encap:Ethernet  HWaddr 00:11:11:9e:58:57  
          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2001:2038:243:de16::f4d1/64 Scope:Global
          inet6 addr: fe80::237:41ff:fe9d:5237/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2874340 errors:0 dropped:0 overruns:0 frame:0
          TX packets:317014 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:348505532 (348.5 MB)  TX bytes:127490351 (127.4 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:68246 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68246 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:35179159 (35.1 MB)  TX bytes:35179159 (35.1 MB) 

Look for a line that says 'inet addr:192.168.###.###' (that does not start with 127.0.) and that is the IP address. So for the example ifconfig output I listed, it would be 192.168.1.15 This would be the address I would use to connect to the computer I ran ifconfig on.