// you’re reading...

How in the Tech

Quick and Dirty File and Print Serving

If you’ve ever spent some time and effort to configure Linux to serve files and printers to other computers on your network, you’ll know there are millions of howtos and write-ups to get you going. The bad news, here is yet another one. The good news, I’ve cut out the fluff and removed the verbose nonsense in order to get you up and running quickly.

  1. First we need to get Samba installed, thankfully Ubuntu makes this a very simple process. Open a terminal window and execute sudo apt-get install samba. Ubuntu will query the package repositories and download and install the latest available samba package.
  2. In that same terminal window type sudo gedit /etc/samba/smb.conf.
  3. In smb.conf, edit the [global] portion by replacing the workgroup = pcworkgroup where pcworkgroup is the workgroup your machine belongs to. You can find this in windows by right-clicking on My Computer->Properties->Computer Name.
  4. Still in smb.conf, create a section for your desired share. Here is an example share titled MyShare and replacing username with your Linux login.
    [MyShare]
    path = /home/username/MyShare
    available = yes
    public = yes
    guest ok = yes
    browsable = yes
    writable = yes
  5. Save the file and in that same terminal window type sudo chmod 777 -R /home/username/MyShare.
  6. Now restart samba with sudo /etc/init.d/samba restart from the terminal.
  7. Finally, on Windows we want to map a driver letter to this share. From My Computer select Tools->Map Network Drive from the menu bar. Enter \\LINUXIP\MyShare in the Folder box and assign it an unused drive letter. LINUXIP is clearly the ip address of your Linux machine.

We’ve got file sharing going now what about sharing out that printer?

  1. From the Ubuntu Gnome interface navigate to System->Administration-Printing. The default interface has this menu at the top of your screen.
  2. Setup your printer
  3. Now select Share Published Printers Connected to this System located under Server Settings.
  4. On the Windows side, point your browser to http://LINUXIP:631/printers
  5. On the loaded website find the printer you just configured in Linux. You will want to right-click on the link and copy the web address. The address will likely be something similar to http://LINUXIP:631/printers/MyPrinter.
  6. Star the Add New Printer Wizard under Printers & Faxes in your Control Panel accessible from the start menu in Windows.
  7. Choose Network Printer, then Connect to this printer. Paste the web address that you copied in step 5.
  8. Install the appropriate Windows print driver; it would be handy to have the original installation disk that came with your printer at this time.
  9. Click Finish.

If you made it this far, you should have a rather simple print and file serving configuration for your network. There are literally books on this particular topic, so be aware that this is just a basic configuration that should be enough to get you up and running. From this framework, you can further massage the configuration for your desired setup.

Good luck!

Related Posts with Thumbnails

Discussion

No comments for “Quick and Dirty File and Print Serving”

Post a comment