Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does any one know ssh -i equivalent for sshfs ? I want to use sshfs without promting for a password

share|improve this question
up vote 3 down vote accepted

The best solution would be ssh-agent as Zoredache suggests.

Another is to put your key in ~/.ssh/id_rsa, that way it will be detected automatically. (Use id_dsa for DSA keys.)

Yet another is ~/.ssh/config. Put something like this in it (see manual page of ssh_config for further details)

Host somebox.somedomain.tld
  User joe
  IdentityFile ~/key_for_somebox

Host *
  IdentityFile ~/key_for_everything_else
share|improve this answer
I discovered the awesome usefulness of the ssh config file not too long ago. It is very useful for multiple key setups. – jdizzle Jan 25 '10 at 13:54

Setup your system to use the SSH Agent and add your key to the agent. If you are using a recent Linux distro (ie Ubuntu and others) ssh-agent may already be setup for you. All you have to do type ssh-add key.

share|improve this answer

Another answer is sshfs -o IdentityFile=/home/me/.ssh/somekey.pem user@host:/path/ mnt/

Additionally, you will see people list another means of evoking sshfs:

sshfs -o ssh_command="ssh -i /home/me/.ssh/somekey.pem" user@host:/path/ mnt/

Though I will agree that ~/.ssh/config is the way to go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.