- Debian Admin - http://www.debianadmin.com -
Mount a remote file system through ssh Using sshfs
Posted By Admin On 3rd September 2007 @ 10:34 In Network | 1 Comment
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
sshfs Features
Install SSHFS in Debian
#apt-get install fuse-utils sshfs
Next, let’s make sure the following condition is met. In the local system, type (as root)
# modprobe fuse
This will load the FUSE kernel module. Besides SSHFS, the FUSE module allows to do lots of other nifty tricks with file systems, such as the BitTorrent file system, the Bluetooth file system, the User-level versioning file system, the CryptoFS, the Compressed read-only file system and many others.
Now you need to make sure you have installed ssh in your debian server using the following command
# 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
You may also be interested in...
Article printed from Debian Admin: http://www.debianadmin.com
URL to article: http://www.debianadmin.com/mount-a-remote-file-system-through-ssh-using-sshfs.html
Click here to print.