Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  116] [ 0]  / answers: 1 / hits: 241146  / 3 Years ago, fri, october 15, 2021, 1:22:31

Pretty simple, I know that this has happened to me before. Couldn't find a good answer on AU.



I was running an ssh session with ports bound:



ssh -L 3000:<server_name>:22


I just lost my connection. When I try to reconnect using the same command, I get the following error:



bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 3000


How do I reset ssh on my machine to allow the port to be bound again? Resetting the local machine works.


More From » networking

 Answers
7

Couldn't you just kill whatever is using that port?



 lsof -ti:5901 | xargs kill -9


lsof -ti:5901 to find whatever is using port 5901.



Pass the whole thing to kill -9 to kill whatever was using port 5901.



Replace with the port you want to open up again.


[#26023] Saturday, October 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tocklftime

Total Points: 110
Total Questions: 109
Total Answers: 100

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
;