Mounting a folder on OSX over SSH

Published by Rob on May 31st, 2010 - in Miscellaneous

It’s suprisingly easy to mount a folder via ssh. This is especially useful when you need to access something via ssh tunnels. Following is the process to follow when using an ssh tunnel.  To do without the tunnel, remove step 3, and make the sshfs command directly reference the server in step 4.

Step 1) get and install macfuse http://code.google.com/p/macfuse, along with the ssh filesystem http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS

Step 2) create a folder to mount to. mkdir -p /mnt/remote

Step 3) setup the ssh tunnel: ssh -C -L 2022:server_with_data_to_get:22 ssh.tunnel.server (going into server_with_data_to_get via ssh.tunnel.server, making this available at localhost:2022).

Step 4) Use sshfs to mount the drive: sshfs -C -p 2022 username@localhost:/path/to/folder_to_mount /mnt/remote (connect to the localhost -ssh tunnel end point- mount remote folder /path/to/folder_to_mount to the local folder /mnt/remote).

Related posts:

  1. SSH Tunnelling is your Friend
  2. Automating Deployment to IBM WebSphere Portal
  3. OSX RDP Client

2 Responses

  1. [...] This post was mentioned on Twitter by Andy Gelme and garduino, Mac OS X Tweets. Mac OS X Tweets said: RT @garduino RT @geekscape: Mounting remote filesystem over SSH on Mac OS X using FUSE http://tinyurl.com/3yaeu7n … handy tip from @… [...]

  2. [...] Bibliography (it’s the responsible thing to do) Parts of this post were based on Rob@Robojek’s post [click here]. [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Rob@Rojotek