annotate content/Linux/sshfs_with_key.md @ 98:1d9382b0329b

Specify the syntax on markdown blocks to avoid broken output that has class=err
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 19 Dec 2019 10:04:33 +0100
parents af7de87037e7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1 Title: sshfs - mounting with private key
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
2 Date: 2014-05-15
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 Lang: en
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5 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.
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
6
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
7 [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).
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 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).
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 Long story short: To mount via sshfs using an existing ssh key, use
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12
98
1d9382b0329b Specify the syntax on markdown blocks to avoid broken output that has class=err
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 30
diff changeset
13 :::shell
30
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
14 sshfs -o IdentityFile=/path/to/the/ssh/private/key host:/dir /mountpoint
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
15
af7de87037e7 added blog post
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
16 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.