diff options
| author | hc <hc@email.ch> | 2025-02-03 18:30:37 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2025-02-03 18:30:37 +0800 |
| commit | 6fb080f913484176640237d223502cdfaf45f66b (patch) | |
| tree | d847348e32720eba20bb0849bec7ee2793f18705 /client_manager.py | |
| parent | 969d9e2382347768415e1d9b61bd8024b20b27cd (diff) | |
Diffstat (limited to 'client_manager.py')
| -rw-r--r-- | client_manager.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/client_manager.py b/client_manager.py index ab29e16..016e76d 100644 --- a/client_manager.py +++ b/client_manager.py @@ -47,6 +47,10 @@ def get_ssh_port(pid): if i in l[1] and "*:" in l[8]: port = l[8][2:] ''' + # using the pid of the ssh connection, get the string of the connection 45.32.108.159:ssh->210.10.76.5:45460 + # then get the other pid with the same string + # then get the other pid + # then get the publicly forwarded port try: lines = subprocess.check_output("lsof -i -n | grep sshd", shell=True, text=True).splitlines() pid = str(pid) |
