Bug 2781 - ssh tunnel doesn't close after logout
Summary: ssh tunnel doesn't close after logout
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.2p2
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-18 20:32 AEST by jg
Modified: 2021-04-23 15:00 AEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jg 2017-09-18 20:32:10 AEST
I noticed that an SSH tunnel won't close until I exit Chrome Browser that was using the tunnel. Shouldn't ssh force close of the connection?


$ ssh -i "jonny3.pem" -C -D localhost:8080 ubuntu@mypc
Last login: Mon Sep 18 07:25:43 2017 from xx.xx.xx.xx
ubuntu@mypc:~$



From my desktop:
$ /usr/bin/google-chrome --user-data-dir="$HOME/chrome-with-proxy" --proxy-server="socks5://localhost:8080"


Try to terminate the ssh connection, and it won't

ubuntu@mypc:~$ logout

<wait 10 seconds>

<close Chrome>

Connection to x.x.x.x closed.
Comment 1 Darren Tucker 2017-09-18 21:34:04 AEST
(In reply to jg from comment #0)
> I noticed that an SSH tunnel won't close until I exit Chrome Browser
> that was using the tunnel. Shouldn't ssh force close of the
> connection?

No.  In SSH2 the connection and the login are distinct things.

> Try to terminate the ssh connection, and it won't
> ubuntu@mypc:~$ logout

No, you're terminating the interactive shell's channel, which is one of possibly many channels within the connection.  If you really want to kill the connection regardless of how many channels are open then use the ~. escape sequence.
Comment 2 Damien Miller 2017-11-03 13:32:48 AEDT
As Darren mentioned, this is by design.
Comment 3 Damien Miller 2021-04-23 15:00:25 AEST
closing resolved bugs as of 8.6p1 release