Hide Forgot
Description of problem: When using the socked forward via -L then after closing the session the socket created on the locale side are not removed. Version-Release number of selected component (if applicable): openssh-clients-7.9p1-5.fc29.x86_64 How reproducible: Every time Steps to Reproduce: 1. ssh foo -L /tmp/foo:/var/lib/mysql/mysql.sock 2. close the connection 3. ssh foo -L /tmp/foo:/var/lib/mysql/mysql.sock Actual results: The 3rd call will fail with: unix_listener: cannot bind to path /tmp/foo: Address already in use Could not request local forwarding. Expected results: Working forward. Additional info: ssh foo -L /tmp/foo:/var/lib/mysql/mysql.sock rm /tmp/foo ssh foo -L /tmp/foo:/var/lib/mysql/mysql.sock Will work, so nothing will use the socket.
AFAIK ssh will try to remove the socket when the forwarding is terminated (is it?), but it might be prevented to do so because either something else is using the socket at the time of exit or some permissions issues (SELinux?). I would probably have to see s strace or ssh debug log to be able to figure out what went wrong. Anyway, always there is a StreamLocalBindUnlink configuration option, which you should also consider.
For selinux I see no exception. Here the output of ssh -vvv on closing the connection: debug3: receive packet: type 98 debug1: client_input_channel_req: channel 1 rtype exit-status reply 0 debug3: receive packet: type 98 debug1: client_input_channel_req: channel 1 rtype eow reply 0 debug2: channel 1: rcvd eow debug2: channel 1: chan_shutdown_read (i0 o0 sock -1 wfd 6 efd 8 [write]) debug2: channel 1: input open -> closed debug3: receive packet: type 96 debug2: channel 1: rcvd eof debug2: channel 1: output open -> drain debug2: channel 1: obuf empty debug2: channel 1: chan_shutdown_write (i3 o1 sock -1 wfd 7 efd 8 [write]) debug2: channel 1: output drain -> closed debug3: receive packet: type 97 debug2: channel 1: rcvd close debug3: channel 1: will not send data after close debug2: channel 1: almost dead debug2: channel 1: gc: notify user debug2: channel 1: gc: user detached debug2: channel 1: send close debug3: send packet: type 97 debug2: channel 1: is dead debug2: channel 1: garbage collecting debug1: channel 1: free: client-session, nchannels 2 debug3: channel 1: status: The following connections are open: #1 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/8 sock -1 cc -1) debug3: send packet: type 1 debug1: channel 0: free: unix listener, nchannels 1 debug3: channel 0: status: The following connections are open: debug3: fd 1 is not O_NONBLOCK Connection to XXXXX closed. Transferred: sent 5464, received 3548 bytes, in 10.1 seconds Bytes per second: sent 538.8, received 349.9 debug1: Exit status 0 On this sample, I only connect and disconnect. The created socket was not used. Calling it via strace, I don't see any attempt to remove the socket.
Using the following works fine: $ ssh -L /tmp/foo:/var/lib/mysql/mysql.sock -oStreamLocalBindUnlink=yes rhel7.virt Reading through the code, there is really not unlink() when the forwarding is canceled/closed. The question is, whether this is intentional or not, but that is for a discussion in upstream bugzilla [1] or on mailing list (usually faster reply) [2]. Please, try to ask there, or I can redirect this bug later. [1] http://bugzilla.mindrot.org/ [2] https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
same for f30
This message is a reminder that Fedora 30 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '30'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 30 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Same for f31
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Same on F32
This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Same on f33