Just a pile of Old Computer Junk "Its life Jim, but not as we know it"

Using SSHFS with a specific identity

The program sshfs is a Linux tool which lets you mount a remote directory accessible via the SSH protocl as a filesystem over fuse. However it defaults to using ‘id_rsa’ as the SSH identity and there are no direct command line options for selecting an alternate identity, or for that matter other SSH parameters such as the TCP port to connect to. The reason for getting sshfs working with additional options was I wanted to try executing some detailed file and archiving operations in my web space, and I wanted to script it locally from my dev machine. SSH access required both a different TCP port and a non-default identity.

The solution:

sshfs -o ssh_command="ssh -i ~/.ssh/somekey -p 11234" \
        user@destination.host: localMountPoint

For the above to work, your local account also needs to be in the ‘fuse’ group (You may need to logout for this to take effect):

sudo groupmod -a -G fuse username

References:

posted in , ,

subscribe via RSS