networking


ssh flags

-L [bind address]    # port:host:hostport (e.g. 8000:localhost:8888)
-N                   # do not execute remote commands
-f                   # requests ssh to go to background before command executes
-p port              # port to connect to on remote host (e.g. -p 8000)
-q                   # quiet mode
-X                   # enable X11 forwarding

lsof

  • find open port and kill process
$ lsof -i:8000
> COMMAND   PID    USER    FD  TYPE  DEVICE               SIZE/OFF  NODE  NAME
  ssh       71504  minghan 7u  IPv6  0x570e3d71af3c38d9   0t0       TCP   localhost:irdmi (LISTEN)

$ kill 71504

EOF

Previous
Next