0

In this example:

$ ssh -L 8001:192.168.122.4:80

the output give is the default help:

usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command]

What could be the reason(s)?

3
  • 1
    The command is incomplete, try adding the remote host at least (if username is the the same on both systems). Commented Apr 21, 2023 at 1:07
  • But there's already an active session; this runs into an ssh-ed into machine
    – Sebi
    Commented Apr 21, 2023 at 1:12
  • 2
    "this runs into an ssh-ed into machine" – Do you want to add port forwarding to a running SSH session? Commented Apr 21, 2023 at 3:05

1 Answer 1

3

The command is incomplete. As you can see in the usage page, the only mandatory argument is destination and you have not specified it.

-L 8001:192.168.122.4:80 is a parameter but it is not the destination.

Each ssh connection is independent, you really need to provide, for each one, at the very least, a destination. That's why you get the usage information.

Try something like this:

$ ssh -L 8001:192.168.122.4:80 destination

You must log in to answer this question.

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