IT/Cloud/Remote Shares/MacOS
Access restrictions were established for this page. If you see this message, you have no access to this page.
- This method works but is not automatic and could be drastically improved. See Issues
- I started to make a bash script to do everything here but ran into problems and decided it wasn't worth it
Installation
Use Terminal
- Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install osxfuse and sshfs
brew cask install osxfuse
brew cask install sshfs
- SSHFS is now installed
Mounting a folder
- Using Terminal
echo "<password>" | /usr/local/bin/sshfs -o password_stdin <username>@<hostname>:<remote folder (must be relative to / without a ~)> <local folder>
Issues
- The big issue is that although the folder is mounted it is not persistent. It breaks if the computer even goes offline, much less restarts. MacOS does not have an fstab file, (actually it does but the OS never uses it. WHY?) so we make a script to mount it again automatically.
- The issue with that is that Mac doesn't let you run bash scripts easily without Terminal. So we use the Mac default program Automator to make ourselves an app to run the scripts.
Making it (semi) automatic
I have not
- Create a standardized directory structure to help us
mkdir -p ~/msgvtefiles/msgvtefiles
- The first msgvtefiles will contain our script and the second will be the actual mount
- Create the script
- Open Automator
- Create new Application
- Add into the workflow "Run Shell Script"
- Command:
umount -f /home/$USER/msgvtefiles/msgvtefiles
- This is to prevent errors about the folder already being mounted (Because errors means I get emails whether the errors mean anything or not)
- Also if you leave this out the mount will sometimes get stuck and need to be forcibly unmounted.
- I realize this isn't very safe but it is here for lack of a better way
- Command:
- Add another "Run Shell Script" into the workflow
- Command:
echo "<password for server>" | /usr/local/bin/sshfs -o password_stdin <username>@<hostname>:<remote folder (must be relative to / without a ~)> <local folder>
- <remote folder> will be something like "/home/msgvte/msgvtefiles"
- <local folder> should be "/home/$USER/msgvtefiles/msgvtefiles"
- Command:
- Test and deal with inevitable errors
- Save in ~/msgvtefiles
- Now we can remount the share by double clicking the app we made.
- Optional: Put the ~/msgvtefiles folder in the favorites in Finder
- Mac users don't really use the home folder so they may have a hard time finding it otherwise