Tiny usability problem with ControlMaster

raf ssh at raf.org
Thu Jan 28 14:53:18 AEDT 2021


Hi,

macos-10.14.6
macports-2.6.4
OpenSSH_8.4p1, OpenSSL 1.1.1i 8 Dec 2020 (via macports)

I've been using ControlMaster, ControlPath and
ControlPersist in my ~/.ssh/config for a little while
now, and I've noticed a tiny problem that I'd like to
fix.

If my current working directory is on a removable
drive's file system (e.g. a USB stick), and I run
ssh/scp to a new host and a new control socket is
created, I later find that I can't unmount the
removable drive, because the long-running ssh process
that holds the control socket open has inherited its
current working directory from my shell when I started
ssh/scp. I need to terminate that ssh process before I
can cleanly unmount the removable drive.

If there's no good reason to retain the inherited
current working directory, would it be OK to change ssh
so that the process that handles the control socket
changes its current working directory, either to the
root directory, or to the user's home directory, or to
the directory containing the ControlPath?

I'm happy to supply a patch or pull request to change
this if it's worthwhile. Is it? Which directory should
the long-running ssh process change to? Changing to the
root directory is the simplest thing with the least
code, and so would be my preference. But the other
choices seem reasonable as well.

Thoughts?

cheers,
raf



More information about the openssh-unix-dev mailing list