# HG changeset patch # User Dirk Olmes # Date 1400154183 -7200 # Node ID af7de87037e772902545d5f05a36311ce6ee253f # Parent 7380bf280fc919bda3556ce8c8972b506d51273f added blog post diff -r 7380bf280fc9 -r af7de87037e7 content/Linux/sshfs_with_key.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/content/Linux/sshfs_with_key.md Thu May 15 13:43:03 2014 +0200 @@ -0,0 +1,15 @@ +Title: sshfs - mounting with private key +Date: 2014-05-15 +Lang: en + +To analyze data on a customer's server, I often hack together small [Groovy](http://groovy.codehaus.org) scripts. I type tiny scripts right in the editor on the remote side but sometimes it's tedious to type over a slowish ssh connection. + +[sshfs](http://fuse.sourceforge.net/sshfs.html) seems to come in quite handy in this case. However everytime I tried before I was unable to make sshfs work with ssh keys (password auth is disabled on the customer machines). + +Now I stumbled over the [Arch Linux](https://www.archlinux.org/)' Wiki which had the right bit of info hidden inside of their [sshfs documentation page](https://wiki.archlinux.org/index.php/sshfs). + +Long story short: To mount via sshfs using an existing ssh key, use + + sshfs -o IdentityFile=/path/to/the/ssh/private/key host:/dir /mountpoint + +This approach even works with an ssh agent. Make sure that you get all prompts out of the way (i.e. asking for the key password etc) before mounting.