screen command leaves pid open on ssh server
I reverse tunnel from a notebook to a ssh server.
A script runs at startup and opens tunnel no problem. Except when the notebook is shutdown, the tunnels ssh pid stays open on the server. It results in a port forwarding error whenever the notebook restarts, because the port is still open and is reserved on the ssh server. Example on the ssh server: Code:
tcp 0 0 0.0.0.0:9874 0.0.0.0:* LISTEN 9021/1 Notebook command: Code:
screen -d -m ssh server.com -l username -R <port>:127.0.0.1:22 Is my screen commands wrong..? |
I think you want to put 'autodetach off' into .screenrc on server.
|
The screen is used on the notebook not the server ( I guess I don't understand screen well enough) :(
What I did is added "autodetach off" to ~/.screenrc of the notebook. And then restarted the notebook. Then Code:
netstat -anp | grep :<port> So again I had to kill the pid on the server quickly. Before the notebook script executed on startup. |
All times are GMT -5. The time now is 11:53 AM. |