For those that do not know SSH or Secure Shell is a networking protocol with uses encryption. There are different ssh clients available however openssh-client is the most popular also comes pre-installed with most linux distrobutions. The server package however in most cases does not as this give be a security risk , so to install this package on a debian/ubuntu host (the computer that has the share) open a terminal and sudo apt-get install openssh-server on other linux systems the package is usually the same name. After the package has been installed we should be able to go to the client (computer you’re wanting to connect from). A quick restart of the networking might need to be done at this point so sudo service networking restart
With that installed now we can connect in terminal with ssh email@example.com , obivously user is the user you want to connect too and ip.address is the ip address of the host. For security reasons never allow the root user to be accessed over ssh , don’t worry most linux distrobutions have this disabled by default. After runnning ssh firstname.lastname@example.org you will be prompted for a password , that is their user password.
If like me you don’t want people to be able to know your user password this where we can create a set of keys where your password is stored and if desired another password can be used instead. To accomplish this open terminal on the host and as the user you want to connect with ssh-keygen , you will then be prompted with , where you would like to save the file , no need to really change this. You will then be prompted for passphrase , leave it empty if you you want to add an entry to fstab later. The next step is to copy the .pub file to the client(s) that want to connect to the host computer , this file goes into /home/user/.ssh/authorized_keys. The authorized_file can contain keys for more than one client , just copy the .pub file from other client and copy them into that file.
The next step is to install sshfs (on the client) so that we can access the host computers share(s) , if on debian/ubuntu based linux open a terminal and sudo apt-get install sshfs . Once installed we need to create a mountpoint i would recommend in /mnt , something like sudo mkdir /mnt/Share also make sure you user has access to it , so sudo chown -R root:root /mnt/Share and then add user to the ‘root’ group. If all that has been setup we can now sshfs email@example.com:/path/to/share /mnt/Share. I would also recommend that the share is located in /mnt on the host and that user1 has access to it whether read/write or just read.
With that all working we can now acces the network share in /mnt/Share , which is fine but if you want to connect to it everytime you boot and dont want to have to type sshfs firstname.lastname@example.org:/path/to/share /mnt/Share everytime you login we can add an entry to fstab so that we can do this , the entry will look something like email@example.com:/share /mnt/Share fuse user,allow_other 0 0.