Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SSHFS allows you mount remote SLAC Unix storage on onto your local desktop or laptop.  You can use SSHFS from anywhere (eg, home or remote network).

...

SSHFS uses the SFTP protocol and SSH authentication.  See https://github.com/libfuse/sshfs for more information. Whilst it is fine for general access, it is not recommended for large data transfers or big files.

  

...

You can use sshfs on Mac and Linux operating systems.

Installation

CentOS 7

...

Code Block
languagetext
sudo yum install sshfs

this will install the fuse-sshfs RPM which comes from the EPEL software repository (Extra Packages for Enterprise Linux).
The fuse-sshfs dependencies, fuse and fuse-libs, come from the CentOS base software repository.

Mac OS

You will need to first install FUSE for macOS. There is also a link for sshfs on the same webpage.

 

Usage

Generally, you define the remote server that has access to the filesystem that you are interested in, and 'mount' that to a local directory on your local desktop or laptop:

 

Code Block
languagetext
# Example: mount all SLAC NFS on your desktop/laptop

mkdir -p ~/sshfs/nfs

...


sshfs 

...

$USER@dtn01.slac.stanford.edu:/nfs ~/sshfs/nfs

# Example: 

...

mount all SLAC AFS on your desktop/laptop

...



mkdir -p ~/sshfs/afs/slac

...


sshfs 

...

$USER@dtn01.slac.stanford.edu:/afs/slac.stanford.edu ~/sshfs/afs/slac

...



Make sure $USER is your SLAC Unix username.  If your local desktop or laptop username is different, replace $USER with your SLAC Unix username.
The first SSHFS command above will mount rhel6-64.slac.stanford.edu:/nfs at your local mount point.  now you can access SLAC's /nfs/slac/... or /nfs/farm/... like this:

 

Then on your local desktop/laptop, you should be able to see your remote files on as if it's on your local filesystem.

Code Block
languagetext
cd ~/sshfs/nfs/slac

...


cd ~/sshfs/nfs/farm

...


cd ~/sshfs/afs/slac

To unmount when you are finished:

...

Code Block
cd                                     # move outside the mount point
/bin/fusermount -u ~/sshfs/nfs

...

         

...

# CentOS 7

...


/sbin/umount ~/sshfs/nfs               # MacOS

cd                                     #

...

 move outside the mount point
/bin/fusermount -u ~/sshfs/afs/slac    

...

# CentOS 7

...


/sbin/umount ~/sshfs/afs/slac

...

          

...

# MacOS

Additional Notes:

  • For RHEL 6 and CentOS 6, you may need to add your username to the local fuse group in the /etc/group file, or else use sudo with the sshfs and fusermount commands.
  • If you use SSHFS to mount remote SLAC AFS space, be aware that the AFS token you get during authentication lasts for 25 hours.

See also

...

https://confluence.slac.stanford.edu/display/SCSPub/Samba+Unix+Storage+Access
https://mountainduck.io/
https://cyberduck.io/

...