Using SSHFS
Submitted by btilma on Wed, 12/31/2008 - 02:30.
sshfs user@host: <mountpoint>
and to unmount:
fusermount -u <mountpoint>
mounting through fstab is a bit trickier. The fstab line looks like:
sshfs#USER@<remote host>:<remote path> <mount point> fuse <sshfs_options> 0 0
thus, a sample for root to mount on bootup, using some common options might be:
sshfs#user@host: /mnt/user_remotehome fuse sshfs_sync,no_readahead,port=22,allow_other 0 0
This would mount a user's remote home directory on /mnt/user_remotehome, using no user translation at all, just standard uid's, but allowing people (users) other than 'root'(who did the mounting on boot) to access it. Without the 'noauto' directive, this would require that either you enter the password for ssh during your machine's boot (very inconvenient), or setup your root's ssh key on your remote machine in that user's account. (perhaps not desirable). A line that would be for a user to do his/her own mounting, and not automatically mount as root on bootup might look more like:
sshfs#user@host: /mnt/user_remotehome fuse sshfs_sync,no_readahead,port=22,user,noauto 0 0
You have to take the allow_other option out, or set 'user_allow_other' in /etc/fuse.conf.
Note that to unmount, you have to be root to use the 'umount' command to unmount the filesystem. This is no problem if you leave it mounted until your machine shuts down, but if you'd like to unmount you'll either have to be root, sudo or use the 'fusermount -u' command.
There are man options to explore, so I'd have a look at the following manpages:
- Login or register to post comments
- 384 reads
Printer-friendly version


