5

In ssh session i pressed ~C then i defined forwarding rule, then got Forwarding port. response, then added another one. how can i view these rules at once? (not by scrolling terminal up)

ssh> ? 
Commands:
      -L[bind_address:]port:host:hostport    Request local forward
      -R[bind_address:]port:host:hostport    Request remote forward
      -D[bind_address:]port                  Request dynamic forward
      -KL[bind_address:]port                 Cancel local forward
      -KR[bind_address:]port                 Cancel remote forward
      -KD[bind_address:]port                 Cancel dynamic forward

wanted command -... display current port forwarding rules

3
  • netstat/ss are your friends. Commented Jun 27, 2018 at 10:50
  • I have netstat on local machine, not on shared remote computer
    – Yurij
    Commented Jun 27, 2018 at 10:55
  • 2
    I am unfamiliar with the prompt you indicate in your terminal example. What software package/ssh client are you using?
    – 0xSheepdog
    Commented Jun 27, 2018 at 16:46

1 Answer 1

6

The following will list the tunnels created by ssh and sshd:

lsof -i -n | egrep 'ssh'

lsof -i -n | egrep 'sshd'

The following will list all zones and port rules:

firewall-cmd --list-all-zones

1
  • Nice! lsof do the trick! IPv6 107472 0t0 TCP [::1]:8888 (LISTEN)
    – Yurij
    Commented Jun 28, 2018 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .