Hoffman2:Sharing Filesystems: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
m (→‎Installation: add install instructions for linux systems)
 
(6 intermediate revisions by 3 users not shown)
Line 49: Line 49:
# Type your password when asked
# Type your password when asked
# Installation should complete smoothly. -->
# Installation should complete smoothly. -->
====macOS====
Download and install the two packages on this website: https://osxfuse.github.io/
Download and install the two packages on this website: https://osxfuse.github.io/
* FUSE for macOS
* FUSE for macOS
* SSHFS
* SSHFS
====Linux====
Red Hat
yum install sshfs
Debian
apt install sshfs


===Usage===
===Usage===
Let's say you want to mount Hoffman2 locally.  On the command line, execute
Let's say you want to mount Hoffman2 locally.  In your Mac terminal, using the command line, execute:
  $ id
  $ id
  uid=1010(joebruinuser) gid=20(bruingroup1),23(bruingroup2),...
  uid=1010(joebruinuser) gid=20(bruingroup1),23(bruingroup2),...
  $ mkdir /Volumes/MOUNTPOINT
  $ mkdir ~/MOUNTPOINT
  $ sshfs -o idmap=user -o uid=1010 -o gid=20 USERNAME@hoffman2.idre.ucla.edu:/path/to/mount /Volumes/MOUNTPOINT
  $ sshfs -o idmap=user -o uid=1010 -o gid=20 USERNAME@hoffman2.idre.ucla.edu:/path/to/mount ~/MOUNTPOINT
Where
Where,
; <code>id</code>
; <code>id</code>
: Gets information about your local user, including your numerical ID and group ID(s)
: Gets information about your local user, including your numerical ID and group ID(s)
Line 65: Line 73:
: Translates your local user and group IDs to that of the remote user so you can read and write files as if you were on the remote machine.  Make sure to put the correct user and group IDs that were returned by the <code>id</code> command.
: Translates your local user and group IDs to that of the remote user so you can read and write files as if you were on the remote machine.  Make sure to put the correct user and group IDs that were returned by the <code>id</code> command.
; <code>USERNAME</code>
; <code>USERNAME</code>
: Is your username at the remote computer
: Is your username at the remote computer.
; <code>hoffman2.idre.ucla.edu</code>
; <code>hoffman2.idre.ucla.edu</code>
: Is the address of the remote computer you are connecting to.
: Is the address of the remote computer you are connecting to.
; <code>/path/to/mount</code>
; <code>/path/to/mount</code>
: Could be left blank to mount your home directory from the remote computer, or it could specify any point in the remote filesystem
: Could be left blank to mount your home directory from the remote computer, or it could specify any point in the remote filesystem.
; <code>MOUNTPOINT</code>
; <code>MOUNTPOINT</code>
: Is the name of the directory where the remote filesystem will be mounted.
: Is the name of the directory where the remote filesystem will be mounted.
Line 76: Line 84:
To unmount:
To unmount:
* Use the command
* Use the command
  umount /Volumes/MOUNTPOINT
  umount ~/MOUNTPOINT
or
or
* Right click on the desktop icon that appears and select ''"Eject."''
* Right click on the desktop icon that appears and select ''"Eject."''


===Permission Error===
SSHFS has two permission checks, one performed by the macOS and one performed by the remote filesystem. In certain cases, the remote host will allow access to the directory but the macOS encounters issues translating the filesystem permissions. This will result in a permission denied error.


If you run into this permission denied error:
* Double check that you are using the correct user and group IDs that were returned by the <code>id</code> command.
* Include the option <code>defer_permissions</code>.
Where,
; <code>-o defer_permissions</code>
: Disables local permission checks and defers all permission requests to the remote server.


==External Links==
<!--==External Links==
*[http://osxfuse.github.com/ OSXFuse]
*[http://osxfuse.github.com/ OSXFuse]
*[http://macfusionapp.org/ MacFusion]
*[http://macfusionapp.org/ MacFusion]
*[http://www.macports.org/ MacPorts]
*[http://www.macports.org/ MacPorts]
*[http://fuse.sourceforge.net/sshfs.html SSHFS]
*[http://fuse.sourceforge.net/sshfs.html SSHFS]-->

Latest revision as of 23:46, 3 February 2021

Back to all things Hoffman2

There are apps for linking filesystems so that you can access data across machines. It's like mounting a shared drive. Here we present a GUI and a command line way of accomplishing this.


MacFusion

MacFusion is no longer working as of macOS 10.12 (Sierra). Please use the command line instructions below.


sshfs

Installation

macOS

Download and install the two packages on this website: https://osxfuse.github.io/

  • FUSE for macOS
  • SSHFS

Linux

Red Hat

yum install sshfs

Debian

apt install sshfs

Usage

Let's say you want to mount Hoffman2 locally. In your Mac terminal, using the command line, execute:

$ id
uid=1010(joebruinuser) gid=20(bruingroup1),23(bruingroup2),...
$ mkdir ~/MOUNTPOINT
$ sshfs -o idmap=user -o uid=1010 -o gid=20 USERNAME@hoffman2.idre.ucla.edu:/path/to/mount ~/MOUNTPOINT

Where,

id
Gets information about your local user, including your numerical ID and group ID(s)
-o idmap=user -o uid=1010 -o gid=20
Translates your local user and group IDs to that of the remote user so you can read and write files as if you were on the remote machine. Make sure to put the correct user and group IDs that were returned by the id command.
USERNAME
Is your username at the remote computer.
hoffman2.idre.ucla.edu
Is the address of the remote computer you are connecting to.
/path/to/mount
Could be left blank to mount your home directory from the remote computer, or it could specify any point in the remote filesystem.
MOUNTPOINT
Is the name of the directory where the remote filesystem will be mounted.


To unmount:

  • Use the command
umount ~/MOUNTPOINT

or

  • Right click on the desktop icon that appears and select "Eject."

Permission Error

SSHFS has two permission checks, one performed by the macOS and one performed by the remote filesystem. In certain cases, the remote host will allow access to the directory but the macOS encounters issues translating the filesystem permissions. This will result in a permission denied error.

If you run into this permission denied error:

  • Double check that you are using the correct user and group IDs that were returned by the id command.
  • Include the option defer_permissions.

Where,

-o defer_permissions
Disables local permission checks and defers all permission requests to the remote server.