diff options
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): | |||
| 47 | if i in l[1] and "*:" in l[8]: | 47 | if i in l[1] and "*:" in l[8]: |
| 48 | port = l[8][2:] | 48 | port = l[8][2:] |
| 49 | ''' | 49 | ''' |
| 50 | # using the pid of the ssh connection, get the string of the connection 45.32.108.159:ssh->210.10.76.5:45460 | ||
| 51 | # then get the other pid with the same string | ||
| 52 | # then get the other pid | ||
| 53 | # then get the publicly forwarded port | ||
| 50 | try: | 54 | try: |
| 51 | lines = subprocess.check_output("lsof -i -n | grep sshd", shell=True, text=True).splitlines() | 55 | lines = subprocess.check_output("lsof -i -n | grep sshd", shell=True, text=True).splitlines() |
| 52 | pid = str(pid) | 56 | pid = str(pid) |
