Mount a remote File System locally

Im using Linux (KDE) and I want to mount my webserver’s home directory to my local machine to make access a little easier.

To do this I will be testing out sshfs.

These are the instructions I followed, which worked and were easy to follow.
They come from Debian Admin

# apt-get install ssh

Using SSHFS

SSHFS is very simple to use. The following command

$ sshfs user@host: mountpoint

This will mount the home directory of the user@host account into the local directory named mountpoint. That’s as easy as it gets. (Of course, the mountpoint directory must already exist and have the appropriate permissions).

Example

create the mount point

#mkdir /mnt/remote

#chown [user-name]:[group-name] /mnt/remote/

Add yourself to the fuse group

adduser [your-user] fuse

switch to your user and mount the remote filesystem.

sshfs remote-user@remote.server:/remote/directory /mnt/remote/

If you want to mount a directory other than the home directory, you can specify it after the colon. Actually, a generic sshfs command looks like this:

$ sshfs [user@]host:[dir] mountpoint [options]

Unmount Your Directory

If you want to unmount your directory use the following command

fusermount -u mountpoint


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *