Mounting AWS SFTP as a Drive (Mac)
Guide to mounting an s3 bucket via SFTP as a drive on your computer
PREP
Check/Create SSH/RSA Keys
The RSA Keys should not have passwords, create new keys (without a password) if the current keys the user has were setup with a password
Setup SFTP Account on AWS
If you’re not an Admin ask one (David, Phill) to create your account
Add the users SSH/RSA key to their FTP account
Make sure the user you use in your computer is an admin on that computer
We’ll need to run commands under `sudo`
SETUP
Download FUSE & SSHFS from https://osxfuse.github.io/
Install FUSE
Install SSHFS
Restart the computer
Open the Terminal App, can be found in the Applications Folder under Utilities
Check sshfs is install with his command ```sshfs --help```
Create two directories, `mnt/patterns`
mkdir ~/mnt
mkdir ~/mnt/patterns
Locate the SSH/RSA Keys
This is probably at `~/.ssh/`,
Save/copy the users FTP account username (ask AWS admin if you don’t have it)
Try connecting/mounting the Drive with this command, replacing RSA Key and Username with the values from the previous two steps
If this doesn’t work try ```sftp -o IdentityFile=RSAPublicKeyLocation username@assets_sftp.boston.gov```
This should work, if not trouble shoot by looking at the logs from the previous command (#1)
Now you are able to mound it’s time to create a Bash script that will run when the user logs in.
Using a Text or Code Editor create a bash file at ```/Library/Startup.sh``
Copy the code below into the file
From the Terminal app, make the file executable: ```chmod +x /Library/Startup.sh```
Get to this file using the `Finder`, then right-click on the file and select the 'Get Info' option. Use the 'Open with:' to use 'Terminal'. Can be found under 'Applications > Utilities' and check the 'Enable' drop down to 'All Applications'
Open up “System Preferences” and go to “Users & Groups”
Switch to the “Login Items” tab, unlock the ability to edit these settings by clicking the Padlock in the bottom left.
Use the “+” button to add a new action in “Login Items”, this will open up a file browser window.
Use the File Browser to locate the “Startup.sh” file we created in the “Library” and select it.
Use the Apple icon on the top left of the screen to “Log Out”
When you sign in again open up a “Finder” window and check if the drive mounted at ~/mnt/patterns
Debug Tips
Last updated