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

When I run

sshpass -p 'mypass' sshfs 'root'@'':/ '/dir' -o StrictHostKeyChecking=no,debug

It successfully mounts but it runs on foreground.

When I run without 'debug' parameter, it doesn't mount at all.

Server is ubuntu 8.04

Any ideas why?

UPDATE: When I run the command as ROOT it does mount. It doesn't work with other users.

here is the output of an unsuccessful mount

$ sshpass -p 'pass' sshfs  'root'@'':/ '/s6' -o StrictHostKeyChecking=no,sshfs_debug,loglevel=debug
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [] port 22.
debug1: Connection established.
debug1: identity file /var/www/vhosts/ type -1
debug1: identity file /var/www/vhosts/ type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
Warning: Permanently added '' (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /var/www/vhosts/
debug1: Trying private key: /var/www/vhosts/
debug1: Next authentication method: password
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending subsystem: sftp
Server version: 3
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: Killed by signal 1.
share|improve this question

You need access to the fuse device and that seems to be require root access.

share|improve this answer
Or being in the fuse group, unless your distro messed up that. – grawity Mar 1 '10 at 13:53
my user is in fuse group - uid=10816(devrim) gid=2523(psacln) groups=2523(psacln),107(fuse) - still no luck :S – Devrim Mar 1 '10 at 22:52
up vote 0 down vote accepted

we couldn't find a solution to this. we are running it on foreground.

share|improve this answer

I've found the same problem: when combining sshfs with sshpass, it only works if sshfs is running in foreground (either with -f or -d). If it's executed in background, it executes normally with exit value 0, but it won't mount anything.

The workaround I've found is executing sshfs in foreground mode, but sending it to background with the shell:

sshpass -f passwordfile sshfs -f origin destination &

This way it will work. Then, when you don't need the mount anymore and unmount it with fusermount -u, the sshfs process will end normally.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.