14

I am forwarding a port of a remote server to my local mac as follows:

ssh -L 15672:localhost:15672 [email protected]

When I do this in a shell, I am also logged into example.com. Yet I would like the command to return and not occupy my shell.

Is there an option to do this?

1 Answer 1

23

You should add -N to avoid getting a shell on the remote, and -f to move the process to the background without losing it if you close the shell.

2
  • great. That was quick. I will accept when stackexchange let's me.
    – user152468
    Apr 30, 2015 at 15:53
  • 2
    The command is ssh -L 3000:localhost:3000 -Nf remote-host
    – vijayst
    Mar 29, 2022 at 17:44

You must log in to answer this question.

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