Created attachment 2097 [details] Patch to add the option "-H path_to_per-user_configdir" to ssh Hi, we are using sshfs to mount the home directories via pam_mount, the server is listed in /etc/ssh/ssh_known_hosts. The problem is, that ssh always wants to read the directory ~/.ssh. When the initial connection is established, the ssh process creates the .ssh directory in the empty mount point directory. That doesn't harm because sshfs can be forced with the nonempty option to mount on that directory even though it is no longer empty. But if the ssh connection to the server breaks and sshfs starts a new ssh process to reconnect, ssh hangs in an uninterruptible sleep (process state = D) when it tries to read ~/.ssh because the mounted home directory is not available... To overcome this deadlock, I patched ssh: I added an new option "-H path_to_per-user_configdir" that allows to use path_to_per-user_configdir/.ssh instead of ~/.ssh. We use now "-H /dev/null". ssh then warns "Could not create directory '/dev/null/.ssh'.", but the sshfs mount works properly, including the reconnect feature. IMHO that patch could also help other people, so I suggest to integrate it in the openssh sources. Thank you, Eberhard
Created attachment 2099 [details] ssh-mkdir.diff don't mkdir when -F specified
Think this patch is better, it suppresses the mkdir when the -F option is passed to ssh so you can use "ssh -F /dev/null"
Suppressing mkdir ~/.ssh is not enough because ssh still tries to open some files in that directory! An alternative patch additionally has to suppress all these open calls! Then it would work, indeed. But I think it is more useful to provide the possibility to use a different directory.
You can suppress other attempts to read/write from ~/.ssh using already-existing configuration options (UserKnownHostsFile etc)
Ok, with the options -oUserKnownHostsFile=/dev/null -oUserKnownHostsFile2=/dev/null -oIdentityFile=/dev/null -F /dev/null your patch would solve the remaining problem.
The patch has been committed, it will be in OpenSSH-6.0
Close all resolved bugs after 7.3p1 release