I am attempting to setup a centralized home-directory server through sshfs and pam-mount.
Currently I am stuck at this point:
When attempting to mount the remote home directory sshfs just gets stuck:
d_inevitable@laptop:~$ sshfs -o nonempty,debug server: .
FUSE library version: 2.9.0
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
It freezes at this point.
This seems to be because the home directory includes ~/.ssh
. So when I try sshfs -o nonempty server:.ssh .ssh
the same thing happens.
I suppose fuse somehow initializes the mount, but then ssh needs something from it's config directory so it tries to read from it. Fuse will just block that read resulting in a deadlock.
What kind of stuff does sshfs need from ~/.ssh
?
I have tried to remove all read/write permissions from ~/.ssh
and then mounting on some other directory. That worked fine. The debug output only complained about writing to .ssh/known_hosts
.
You are right, fuse initiates the mount first, then initiates the ssh process. This causes a problem for you, since by default ssh reads
~/.ssh/ssh_config
,~/.ssh/known_hosts
,
~/.ssh/id_*
files from user home. This behavior can be changed:~/.ssh/ssh_config
is the default per-user configuration file. An alternative per-user configuration file can be specified using-F
option, or use-F /dev/null
to specify no per-user configuration file.~/.ssh/known_hosts
is used to store and check host keys. You can use-o UserKnownHostsFile=/dev/null
, and either manually add the host key to/etc/ssh/ssh_known_hosts
or use-o StrictHostKeyChecking=no
.~/.ssh/id_*
files are identity files by default used for client authentication. If you want to authenticate using an identity file, you need to keep it outside the home directory and use-o IdentitiesOnly=yes -o IdentityFile=<path to private key>
. Or else you can authenticate interactively if you use-o IdentitiesOnly=yes -o IdentityFile=/dev/null -o PubkeyAuthentication=no
.For example to mount home using sshfs, authenticating using password, without host key checking, run