If you’re trying to create an SSH tunnel, you may find that running the command just logs you into the remote server.
ssh -L 27017:somehost:27017 email@example.com
To solve this, you need to use the -N flag.
ssh -L 27017:somehost:27017 -N firstname.lastname@example.org
This will then just set up the forwarding, and not run the command.