====== SSHFS-SDF ======

===== How to mount your SDF user folder locally on your linux workstation. =====

[[#intro|Overview]][[#install|Installing on your machine]][[#athome|Use on your machine]][[#atma|Use on the Meta-Array]]

====== OVERVIEW:What is sshfs? ======

SSHFS (SSH File System or Secure SHell File System) is a file system client to mount and interact with directories and files located on a remote server or workstation. The client interacts with the remote file system via SFTP. It appears on your file system as if it were a local directory and you can manipulate the files as you would normally on your workstation.

The current implementation of SSHFS using FUSE is a rewrite of an earlier version. The rewrite was done by Miklos Szeredi, who also wrote FUSE sshfs is a way to mount file systems on a network server on your client machine sshfs to mount network drives via ssh to local machine.

====== How to install Ubuntu/Debian Linux example ======

  * On command line use apt-get to install sshfs

sudo apt-get install sshfs

  * Create a director in your /media folder to mount the sdf user folder to

sudo mkdir /media/sdf

  * Change ownership to you local systems user name

sudo chown your-local-system-username /media/sdf

  * Add you local system user name to the fuse group

sudo adduser your-local-system-username fuse

====== How to mount the SDF user folder ======

Your path to your user name depends on the letter your user name begins with. Someuser is below in the example you will need to tailor it to your own user name. You can use the pwd command at the shell to see where exactly it is. The last part of the command tell it where to mount on local system.

You could also mount your www folder as well you need to run the mkhompg command to see where it is. Note if you plan to mount both you need to create a seperate folder for each folder you plan to mount on your local machine.

sshfs sdf.lonestar.org:/arpa/ns/s/someuser /media/sdf

====== How to unmount the SDF user folder ======

  * Adds it to modprobe

sudo modprobe fuse

  * Unmounts file system

fusermount -u /media/sdf

====== More info on sshfs ======

http://fuse.sourceforge.net/sshfs.html

----

====== Mounting directories from other machines on the [[http://sdf.org/?tutorials/metaarray|Meta-Array]] ======

fuse-sshfs is installed on the Meta-Array, so you may use the above instructions to mount any ssh accessible machine to a local folder on ma.sdf.org

sshfs example@example.com:/home/example "$HOME/example_mountpoint" -o follow_symlinks

As above, you can unmount using fusermount

fusermount -u $HOME/example_mountpoint

In order to map your remote userid and groupid so that permissions and ownership works use the idmap and gid options

sshfs example@example.com:/home/example "$HOME/example_mountpoint" -o follow_symlinks -o idmap=user -o gid=500

where 500 is the gid for the ARPA group

[0 ~/remote/code]$ touch main.c

After creating file over an sshfs-mounted filesystem, a listing indicates correct user and group ownership

-rw------- 1 xcitor arpa 0 Jul 10 01:08 main.c

----
$Id: sshfs.html,v 1.9 2012/07/10 10:51:33 xcitor Exp $