Monthly Archives: May 2010

Mounting a folder on OSX over SSH

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