Computing, file sharing, Linux, security, Ubuntu

Using SSHFS for simple file sharing

The SSHFS file system can be used for simple file sharing between computers. It only requires that the server has SSH installed, and that you can install SSHFS on your local computer.

Pros:

  • Secure SSH encryption
  • Very easy to set up

Cons:

  • Only intended for one user at a time

On the server side, you only need a standard SSH server. It provides encryption and file services to clients. No special configuration is needed

On the client side, you need the SSHFS file system to mount the network share. On ubuntu, this can be installed with:

sudo apt install sshfs

Then you can mount a remote user’s folder with

sshfs -o idmap=user $USER@$REMOTEHOST:$REMOTEFOLDER $LOCALFOLDER

Replace $USER with the user name on the remote computer. You will get access to that user’s home directory.

Replace $REMOTEHOST with the address of the computer you want to connect to.

Replace $REMOTEFOLDER with the folder you want access to. This is relative to the user’s home directory.

Replace $LOCALFOLDER with the local folder you want to mount the share on.

-o idmap=user” translates the remote user id of the files to your own user id, and vice versa. Files that are owned by $USER on the server, will appear owned by you in the local mounted directory.

One thought on “Using SSHFS for simple file sharing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s