[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#904392: openssh-client: The ssh client doesn't reset working directory when it daemonizes itself



Package: openssh-client
Version: 1:7.4p1-10+deb9u3
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

The OpenSSH client has a possibility that it daemonizes itself and
multiplexes multiple sessions through a single connection. This improves
connection setup time if the user makes multiple connections to the same
machine.

When the OpenSSH client daemonizes itself, it doesn't reset current
working directory to some safe location. Consequently, if the user is in
some directory that is on an external mounted device, the device can't be
unmounted because the openssh client keeps its working directory on that
device.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

1. add these three lines to the end of /etc/ssh/ssh_config
ControlMaster   auto
ControlPath     ~/.ssh/socket-%h-%p-%r
ControlPersist  60

2. mount some external device
3. go to the mounted directory
4. use openssh to connect to some remote host
5. close the connection
6. go to your home directory
7. try to unmount the external device - it fails

   * What was the outcome of this action?

The unmount fails because the openssh client keeps the current working
directory on the external device.

   * What outcome did you expect instead?

The openssh client should reset the current working directory to a root
directory (or perhaps the user's home directory) when it daemonizes
itself, so that the user may unmount the external device.

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: 9.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: arm64 (aarch64)
Foreign Architectures: armel, armhf

Kernel: Linux 4.17.4 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8), LANGUAGE=cs_CZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages openssh-client depends on:
ii  adduser           3.115
ii  dpkg              1.18.25
ii  libc6             2.24-11+deb9u3
ii  libedit2          3.1-20160903-3
ii  libgssapi-krb5-2  1.15-1+deb9u1
ii  libselinux1       2.6-3+b3
ii  libssl1.0.2       1.0.2l-2+deb9u3
ii  passwd            1:4.4-4.1
ii  zlib1g            1:1.2.8.dfsg-5

Versions of packages openssh-client recommends:
ii  xauth  1:1.0.9-1+b2

Versions of packages openssh-client suggests:
pn  keychain      <none>
pn  libpam-ssh    <none>
pn  monkeysphere  <none>
pn  ssh-askpass   <none>

-- Configuration Files:
/etc/ssh/ssh_config changed [not included]

-- no debconf information


Reply to: