Digital Team
About UsEdit in Gitbook
  • Welcome
  • Getting started
    • Life on the Digital team
      • Meetings
      • Communication
      • Software engineering working agreement
    • Contributing to Boston.gov
    • Using GitBook
  • Standards & best practices
    • Digital Team Release Notes
    • Working with Partners
    • Accessibility at COB
      • Developers
      • Content Editors
        • How to guide
      • Resources
      • Working with Iterators
    • Analytics and Metrics
    • Code of Conduct
    • General
    • Code reviews
    • Project Management
    • Git / GitHub
      • Contacts at Github
      • Git Command Tips
      • GitHub Service Accounts
    • Code quality
      • Automated tests & static analysis
      • Code comments
      • Style guides
        • Drupal/PHP
          • D8 Dependency Injection (DI)
        • React/TypeScript
    • Technical documentation
    • Hosting and monitoring
    • Deployment
  • Guides
    • Technology stack and technologies used
      • Web applications
    • Drupal - boston.gov
      • Custom Development & Configuration
        • On Demand Instances
          • Acquia Environment setup checklist
        • Continuous Deployment Process
        • Developer Onboarding
          • Step 1: Local Dev Environments
          • Step 2: Version control
          • Step 3: Introduction to Drupal
          • (to be sorted)
            • Development environment
              • PHP CodeSniffer
              • VSCode IDE Setup
              • AWS for Developers
              • Using Windows
            • Installation instructions
              • Typical build output
              • Lando 101
              • Verify Installation
                • Local Patterns installation
              • Windows install
              • PhpStorm settings configurations
          • Step 4: Site Building in Drupal 8
        • Site Development Notes
          • Git Best Practices - Drupal
          • Drupal Cache
          • Drupal Config
          • Custom Modules
            • Custom Themes
              • Front-end Theme (bos_theme)
                • Site Breadcrumbs
              • Back-end Theme (bos_admin)
            • Adding Templates to Custom Modules
            • Custom Content Types
              • D7 -> D8 Conversion
              • Content Editor UX
                • Content Moderation
              • In-page Navigation Menu
            • Custom Paragraphs
              • D7 -> D8 Conversion
            • Custom Taxonomies
            • WebApps
          • Drupal UX-specific
            • Image Styles & UX
            • Example Content Pages
          • PHPStorm IDE
        • CKEditor
      • Drupal Apps/Content Types
        • Budget Website
        • Building Housing
          • BH Drupal Entities
          • BH Map Webpage
          • BH Property Webpage
            • BH Project Timeline
          • BH Salesforce Sync
            • Salesforce Contributed Module
        • Contact Form
        • Election results
        • Google reCAPTCHA
        • My Neighborhood Lookup
        • Metrolist
        • Metrolist (Drupal)
        • Project Tracker
          • Content Types (& Paragraphs)
          • Taxonomies
          • Views
          • Developer Notes
      • Drupal Features & Components
        • Single Sign On (SSO)
          • Drupal SAML Knowledgebase
          • SamlAuth
        • Maps on boston.gov
        • Charts on boston.gov
          • Quick Overview
          • Chart Data
          • Chart Configuration
          • Advanced Concepts and Techniques
          • Charts on boston.gov (legacy)
          • Useful Resources
      • Drupal micro-services (API end-points)
        • Integrating with Boston.gov
        • Assessing Forms Endpoint
        • Bos311 API
        • Cityscore
          • Knowledge Base
        • PDF Manager Module
        • PostMark Email Services
          • Postmark Knowledgebase
        • Upaknee Email List Services
        • Public Notices
        • Site Alerts
          • CodeRed Subscription
      • Drupal - Weekly Maintenance
      • Drupal - Periodic Maintenance
    • Digital Webapps
      • Libraries and Tools
        • Emotion
        • Storybook
        • Rollbar
      • Services
        • AWS-hosted Microservices
          • SQL Proxy API (DBConnector)
            • Developer Notes
          • PDFToolkit API (DB Connector)
            • Developer Notes
      • Webapps - Maintenance
      • Webapps
        • Boston Family Days
        • Property Tax Calculator
        • Access-Boston
          • Updating IAMDIR/Group Management/LDAP certificates
          • Node Server
          • Portal App Tile Configurations
          • Ownership of Concerns
          • Updating SAML Certificates
          • Applications/Services
            • Group Management
            • Confirm ID/ID Verification
            • Preferred Name
        • Sanitation Scheduling
        • Registry-Certs
          • Marriage Intention
      • DevOps
        • New service setup
          • Non-Monorepo Service Setup
        • Service Configuration
          • Editing a project’s configuration using Cyberduck
        • Managing AWS
          • Production Overview
          • AWS Bastion Access
          • Terraform
            • Updating the ECS cluster AMI
          • Restarting an ECS service
          • Encrypting service configuration for S3
          • Mounting AWS SFTP as a Drive (Mac)
        • Webapp Deployment
          • Deploy to AWS 2021
            • Deploy Tool (cob_ecrDeploy)
    • Fleet - Pattern Library
      • Patterns Library Architecture
      • Icon Library Architecture
      • Developers
        • Local Development for Drupal Developers
      • Patterns Library Maintenance
    • Legacy Website - cityofboston.gov
      • Animal Control
        • Dog Licenses
      • No Tow
        • Street Sweeping Reminders
        • Street Occupancy Alerts
        • Towing Alerts
        • Towing Search
        • Subscription Search
        • Proposed Restructure
          • Backend
        • Reillys Notes
      • Workers' Compensation Inquiry Form
      • Streetbook
      • Legacy Website - Maintenance
        • Animal Control Maintenance
        • Assessing Online (AOL) Maintenance
          • Knowledge-base
          • Disclosure Period
          • Annual PDF Initialization
          • Database Tables
        • No-Tow Maintenance
    • AgilePoint
      • AgilePoint: Adding Users
      • Migrating AGP Applications from one platform to another
    • The Hub - hub.boston.gov
      • The Hub - Maintenance
    • Maintenance
      • Updating SSL Certificates
    • Redirects
      • Redirecting from cityofboston.gov
      • URL redirects versus URL aliases - Drupal
      • DNS Redirects
    • Decommissioned Apps or Services
      • Archived Forms Information
      • CodeRed
      • Drupal 7
        • Deployment (2019)
          • Why do we peer-review pull-requests ?
      • Rentsmart
      • SnowStats
      • Ruby
    • Weglot translation
      • What to do in Weglot
      • What to do on the website or page
        • Softr
        • Drupal Powered Pages
        • Custom Pages
  • Projects
    • Project: Patterns Library Cleanup
      • Project: Refactoring Legacy CSS
        • Strategy
        • Regression Testing
        • Maintenance
    • Project: Upaknee
    • Project: Everbridge API + UI
    • Project: 311 CRM Upgrade
      • Project: City Worker Upgrade to City Worker 5
      • Project: Lagan 311 CRM upgrade to 15r4
    • Project: Fleet (Pattern Library Design System)
    • Project: Monorepo Decoupling
    • Inactive projects
      • Project: 311 (Salesforce Upgrade)
      • Project: Access Boston
        • General/Historical Documentation
          • Edit Config and Upload Icons
        • Processes
          • Process: Adding New Icon to Access Boston Website
          • Process: Non-icon Access Boston Feature or Bug Requests
          • Self-Service
      • Project: Alexa Skill
      • Project: Assessing Online
        • 2022 Notes
      • Project: Boards and commissions
      • Project: City Hall Appointment Scheduler
      • Project: CityScore
      • Project: Mobile Apps
      • Project: Permit Finder
      • Project: Public Notice Signage
      • Project: Registry Suite
        • Birth certificates
        • Marriage Certificates
        • Marriage Intention
        • Death Certificates
      • Project: Work With U.S. Digital Response Team
      • Project: TDM Points App
      • Project: Translation on boston.gov
  • External resources
    • Learning resources
    • Reference links
    • Applications and extensions
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Guides
  2. Digital Webapps
  3. DevOps
  4. Managing AWS

Mounting AWS SFTP as a Drive (Mac)

Guide to mounting an s3 bucket via SFTP as a drive on your computer

PreviousEncrypting service configuration for S3NextWebapp Deployment

Last updated 5 years ago

Was this helpful?

PREP

  1. Check/Create SSH/RSA Keys

    1. 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

  2. Setup SFTP Account on AWS

    1. If you’re not an Admin ask one (David, Phill) to create your account

  3. Add the users SSH/RSA key to their FTP account

  4. Make sure the user you use in your computer is an admin on that computer

    1. We’ll need to run commands under `sudo`

SETUP

  1. Download FUSE & SSHFS from

    1. Install FUSE

    2. Install SSHFS

  2. Restart the computer

  3. Open the Terminal App, can be found in the Applications Folder under Utilities

  4. Check sshfs is install with his command ```sshfs --help```

  5. Create two directories, `mnt/patterns`

    1. mkdir ~/mnt

    2. mkdir ~/mnt/patterns

  6. Locate the SSH/RSA Keys

    1. This is probably at `~/.ssh/`,

  7. Save/copy the users FTP account username (ask AWS admin if you don’t have it)

  8. Try connecting/mounting the Drive with this command, replacing RSA Key and Username with the values from the previous two steps

    1. sshfs -o IdentityFile=RSAPublicKeyLocation -odebug,sshfs_debug,loglevel=debug -o defer_permissions -o noappledouble -o volname=patterns username@assets_sftp.boston.gov:/patterns.boston.gov/assets ~/mnt/patterns/
    2. If this doesn’t work try ```sftp -o IdentityFile=RSAPublicKeyLocation ```

    3. This should work, if not trouble shoot by looking at the logs from the previous command (#1)

  9. Now you are able to mound it’s time to create a Bash script that will run when the user logs in.

  10. Using a Text or Code Editor create a bash file at ```/Library/Startup.sh``

  11. Copy the code below into the file

    #!/bin/sh
    
    USERNAME=sftp_username
    RSAPUBLICKEYLOCATION=~/.ssh/id_rsa
    MOUNTLOCATION=~/mnt/patterns/
    
    sshfs -o IdentityFile=$RSAPUBLICKEYLOCATION -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o defer_permissions -o noappledouble -o volname=patterns $USERNAME@assets_sftp.boston.gov:/patterns.boston.gov/assets $MOUNTLOCATION
  12. From the Terminal app, make the file executable: ```chmod +x /Library/Startup.sh```

  13. 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'

  14. Open up “System Preferences” and go to “Users & Groups”

  15. Switch to the “Login Items” tab, unlock the ability to edit these settings by clicking the Padlock in the bottom left.

  16. Use the “+” button to add a new action in “Login Items”, this will open up a file browser window.

  17. Use the File Browser to locate the “Startup.sh” file we created in the “Library” and select it.

  18. Use the Apple icon on the top left of the screen to “Log Out”

  19. When you sign in again open up a “Finder” window and check if the drive mounted at ~/mnt/patterns

Debug Tips

# Manual Mount
sshfs -o IdentityFile=~/.ssh/id_rsa_cob -odebug,sshfs_debug,loglevel=debug -o defer_permissions -o noappledouble -o volname=patterns phillip_kelly@assets_sftp.boston.gov:/patterns.boston.gov/assets ~/mnt/patterns/

Unmount
- diskutil unmount ~/mnt/assets/
- sudo mount -a

CHOWN
780  sudo chown phillipkelly /Users/phillipkelly/mnt/patterns2/

CHMOD
672  sudo chmod 777 ~/mnt/assets
794  sudo chmod +x ~/Library/Startup.cmd

https://osxfuse.github.io/
username@assets_sftp.boston.gov