I have two Ubuntu boxes and want to share files and printer between them. I'm reading about Samba but I have a question: Is Samba only for sharing thing between Ubuntu and Windows? Another question: There is a lot of information describing hot to share files and printer between Ubuntu and Windows, but what about two Ubuntu boxes? How can I do that? Is there how-to I can follow?
Use NFS to share file between systems if there is no windows involved, it is so easy.
Install nfs-kernel-server and nfs-common on the computer that has the files to be shared. These can be installed in the Software Center, or however you prefer to install packages. You can install them on the command-line with:
You need to edit the exports file that shows what to share and with whom. So run:
For example, to give full read and write permissions, allowing any computer from 192.168.1.1 through 192.168.1.255, add this line to
My daughter's export file looks like this (I am
Restart the NFS server by running:
(Or just reboot the computer.)
From now on after editing the
Then install nfs-common on the computer that wants to mount the export shares as part of its file system.
Reboot and the share is mounted in
Set up a server on the client and client on the server for two-way shares.
You can print to a shared printer with CUPS (as mentioned in this answer).
For sharing files between Linux/Unix hosts over a trusted network NFS is usually the best option.
You can use Samba the same way to share between 2 Ubuntu machines.
Alternatively, you can also use CUPS directly to share printers, and one of the other supported network filesystems to share files (or if you have a SSH server set up, just use sftp:// in Nautilus).
One possible advantage of using Samba is that it will also work if you ever need to share something with a Windows or Mac OS X user (e.g. a visitor with a laptop).
You can use the built in Ubuntu One for file sharing easy and straight forward to setup.
This article should help with sharing printer, but it is mostly dependent on the brand of the printer as well.