Hoffman2:Sharing Filesystems: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
m (→‎Installation: add install instructions for linux systems)
 
(13 intermediate revisions by 5 users not shown)
Line 6: Line 6:


==MacFusion==
==MacFusion==
GUIs are nice, and things just work here.
MacFusion is no longer working as of macOS 10.12 (Sierra).  Please use the [[Hoffman2:Sharing Filesystems#sshfs|command line]] instructions below.
<!-- GUIs are nice, and things just work here.




===Installation===
===Installation===
# Go to [http://osxfuse.github.com/ http://osxfuse.github.com/] and download and install OSXFuse.
# Go to [http://osxfuse.github.com/ http://osxfuse.github.com/] and download and install OSXFuse.
# Go to [http://macfusionapp.org/ http://macfusionapp.org/] and download and install MacFusion.
# Go to [https://github.com/ElDeveloper/macfusion2 MacFusion] and download and install MacFusion (Download a build of the development version).
 


===Usage===
===Usage===
Line 28: Line 28:
#* '''Password''' - leave this blank if you want to type your password (for the server) every time you connect (more secure). Or just plug in your password (to the server) for convenience.
#* '''Password''' - leave this blank if you want to type your password (for the server) every time you connect (more secure). Or just plug in your password (to the server) for convenience.
#* '''Path''' - by default it will connect to your home folder on the server, but you can specify any part of the filesystem you have access to.
#* '''Path''' - by default it will connect to your home folder on the server, but you can specify any part of the filesystem you have access to.
# In the "Advanced" tab:
#* '''Options''' - to stop the program from giving you a hard time about what you do and don't have permission to read, add the text
#*: <pre>-o defer_permissions</pre>
# In the ''Macfusion'' tab:
# In the ''Macfusion'' tab:
#* '''Mount Point''' - where on your local filesystem you want this drive mounted.
#* '''Mount Point''' - where on your local filesystem you want this drive mounted.
#* '''Volume Name''' - what name do you want the drive to have? This is the name that shows up under the icon that will appear on your desktop.
#* '''Volume Name''' - what name do you want the drive to have? This is the name that shows up under the icon that will appear on your desktop.
# Click ''"OK"'' when you are done.
# Click ''"OK"'' when you are done.
# Click ''"Mount"'' on the new connection that appears and type in your password if  
# Click ''"Mount"'' on the new connection that appears and type in your password if -->




==sshfs==
==sshfs==
This tool is pre-installed on all lab computers (type <code>which sshfs</code> on the command line to check). But if this is your own computer, follow the install instructions.
<!-- This tool is pre-installed on all lab computers (type <code>which sshfs</code> on the command line to check). But if this is your own computer, follow the install instructions. -->




===Installation===
===Installation===
Command lines can be more extensible
<!-- Command lines can be more extensible
# [http://www.macports.org/install.php Install MacPorts].  The instructions they have over there are great.  This is a package distribution tool where you can easily find and install other tools like [https://trac.macports.org/browser/trunk/dports/sysutils/watch/Portfile watch], different versions of python, and [https://trac.macports.org/browser/trunk/dports/sysutils/htop/Portfile htop].  The best part is that it installs all the dependencies for you.
# [http://www.macports.org/install.php Install MacPorts].  The instructions they have over there are great.  This is a package distribution tool where you can easily find and install other tools like [https://trac.macports.org/browser/trunk/dports/sysutils/watch/Portfile watch], different versions of python, and [https://trac.macports.org/browser/trunk/dports/sysutils/htop/Portfile htop].  The best part is that it installs all the dependencies for you.
# Execute
# Execute
#: <pre>$ sudo port install sshfs</pre>
#: <pre>$ sudo port install sshfs</pre>
# 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/
* FUSE for macOS
* 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 60: 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 71: 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.