Timeline for How to cleanup SSH reverse tunnel socket after connection closed?
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 14, 2018 at 12:09 | vote | accept | Timo | ||
| Mar 13, 2018 at 9:50 | answer | added | Timo | timeline score: 37 | |
| Mar 1, 2018 at 20:13 | comment | added | Timo |
@meuh Right now my best hack to solve this is to basically netstat -a --unix and cross reference that to all socket files I can find based on our naming convention and delete all socket files that weren't listed by netstat. This is now run on cron every minute. It seems to be working alright, maybe I'll post it as an answer at some point if better candidates do not appear. Probly should move the files under /run anyway though as putting them under home directories is rather unorthodox. So thanks @meuh for reminding about that. :)
|
|
| Mar 1, 2018 at 19:56 | comment | added | Timo | Maybe that is the intended way of using reverse tunnels? Does not suit our purposes though as the server can't be constantly rebooting and disconnecting everyone. But then again bound ports are freed after tunnels get closed, why aren't socket addresses? | |
| Mar 1, 2018 at 19:41 | comment | added | meuh |
Your system might be providing each user with their own directory under /run/user/1000/ and so on you could use instead. This is a tmpfs lost on reboot.
|
|
| Feb 28, 2018 at 13:04 | comment | added | Timo |
@RuiFRibeiro can you elaborate on how would autossh solve my problem with the sockets on the server not being cleared? I thought it's basically a client side wrapper around ssh to detect broken tunnels and recreate them?
|
|
| S Feb 28, 2018 at 12:56 | history | suggested | 13dimitar | CC BY-SA 3.0 |
improve formatting
|
| Feb 28, 2018 at 12:35 | review | Suggested edits | |||
| S Feb 28, 2018 at 12:56 | |||||
| Feb 28, 2018 at 12:31 | review | First posts | |||
| Feb 28, 2018 at 12:35 | |||||
| Feb 28, 2018 at 12:26 | comment | added | Rui F Ribeiro |
Have a look at autossh
|
|
| Feb 28, 2018 at 12:24 | history | asked | Timo | CC BY-SA 3.0 |