How To Set Up a Local Network for File and Printer Sharing


NOTE :-  This page needs updating to cover Ubuntu 8.04 (Hardy Heron) as the networking setup has changed

Introduction

    There are three things involved in setting up local networking

Installing the Networking utility Samba

    In order to use a local network (LAN) with Ubuntu you need to install a suitable networking application.  Samba is recommended particularly if you are likely to use a Windows computer on the network.  This may be installed from System > Administration > Synaptic Package Manager.  Use Search to find samba then click on the box beside samba and choose Mark for installation, followed by Apply (twice) to install in the usual way.  The Samba documentation may also be useful while Synaptic is open.

Making other networked computers accessible from the Ubuntu machine

    Firstly, run all computers to be networked. Use the router status or settings to get the IP addresses of the other computers or go into the Network Settings in those machines to get the allocated LAN IPs

In System > Administration > Network  --- Network Settings > General tab --- Host name is the name of the computer and Domain name is the network (workgroup) name eg. MSHOME (for compatibility with Windows)

In order to see your other computers via the network their IP addresses have to be added in Network Settings > Hosts tab
Click the Add button and enter the IP and a memorable name for the computer.  It is helpful if you adopt a standard naming convention for the computers on the network.  Also, I suggest setting fixed IP addresses in the router setup so that these don't change when computers are turned off and on again.  Another way is to set each computer to a fixed IP address in each one's Network Settings (Connections tab) and the equivalent for Windows machines sharing the network.  Note that these addresses are of the form 192.168.x.y where x is usually 0 or 1 depending on the make of router and y is the individual device (computer) allocation.  These are IP addresses for the local network and nothing to do with the internet IP that you ISP assigns.  This is a common cause of confusion.

File Sharing

    In order to share files over the network you have to set which files/folders are to be shared (as in Windows).
Goto System > Administration > Shared Folders - enter password - In Shared Folders dialog click Add - In the Share Folder dialog Path dropdown navigate to the folder to share, choosing Other if required - Open the appropriate folder (You may also create a new folder here) - drop down Share through and choose Windows networks (SMB) - add a comment if required (to explain what the folder is) - untick Read only if you want to be able to write to this folder from other computers on the network - when done click OK.  Repeat as required adding folders to the list.  Click Close when done.  

Access permissions of the shared folders and their contained files may be set in the usual way ie. right-click on the folder and choose Properties - then Permissions tab and set appropriately eg. in Others set Folder Access to Create and delete files and File Access to Read and write - click Apply file permissions to enclosed files.   These folders should now be accessible from other computers on the LAN.

Printer Sharing

Ubuntu 7.04 Feisty Fawn
    Goto System > Administration > Printing and in the Printers dialog menu Global Settings set Share Printers.  If you want to use a printer on another computer on the network set Detect LAN Printers.

Ubuntu 7.10 Gutsy Gibbon

    On the server machine (the one the printer is attached to) open up printer manager with System > Administration > Printing and under Server Settings tick (turn on) Share published printers connected to this system.

    Now on the computer(s) you want to print from, again open up the printer manager with System > Administration > Printing and under Server Settings turn on Show Printers shared by others systems.

For more info, including earlier versions see the appropriate Ubuntu Wiki page


Updated 2 January 2008