There are a few ways to do this. An nfs share is good for performance and ease, but it's less secure (unless you set it up to use nfsv4). An sshfs share is more secure, but you'll have to either enter your password every time you want to connect or you'll want to set up password-less key based authentication.
Here's the nfs method:
- - - nfs share - - -
On server, run the following commands:
Code:
sudo apt-get install nfs-kernel-server
sudo vi /etc/exports
Use vi (or something else) to edit /etc/exports to include the following line:
Code:
/home/myuserhomedir/ *(rw,async,no_root_squash,no_subtree_check)
sudo service nfs-kernel-server restart
sudo service idmapd restart[/code]
Replace "myuserhomedir" with your home directory.
On client, run the following commands:
Code:
mkdir ~/remhome
sudo apt-get install nfs-common
vi /etc/fstab
Use vi (or something else) to edit /etc/fstab to include the following line:
Code:
10.42.0.1:/home/myuserhomedir /home/myuserhomedir/remhome nfs noauto,rw,user,exec 0 1
Replace 10.42.0.1 with your server's IP address. You can optionally create an entry in /etc/hosts or set up a local nameserver so you can replace the IP address with a user friendly computer name.
This entry sets up an nfs mount, which you can manually mount or umount using the GUI. You can also set it up to automatically mount, but this may not necessarily work exactly when you want it to.
- - - - - -
Here's the sshfs method
- - - sshfs share - - -
On server, install ssh server if not already installed. That is all!
Code:
sudo apt-get install openssh-server
On client, test connection by trying to log into your server:
Replace 10.42.0.1 with the IP address of your server.
On client, install sshfs, if necessary, with this:
Code:
sudo apt-get install sshfs
Create the remote share folder with:
Now, you can mount the remote share with:
Code:
sshfs 10.42.0.1: ~/remhome
And you can umount it with:
Code:
fusermount -u ~/remhome
You can optionally set up icons to run these commands. If you want to eliminate the password step, you can set up password-less key based authentication (look this up on the Internet to see how).
Personally, I prefer to mount the remote share in the same local folder as the remote, but this doesn't really work out for the home directory. So, for example, I might create the same folder in both the server and client, so the client mount location is identical to the remote location. This is convenient for making symbolic links work the same on the server and client.