Score:0

Ssh portforwarding options are working in the command line but not when using ssh config file

jp flag

This works in the command line.

ssh -i ~/.ssh/id_rsa x.x.x.x -p 22 -R <IP1>:10001:localhost:9090 -R <IP2>:10001:localhost:22

But when using the ssh config file, it fails. Below is the contents of the config file.

Host decryptor
  HostName      x.x.x.x
  User          sshtunnel
  Port          10022
  IdentityFile  ~/.ssh/id_rsa
  RemoteForward <IP1>:10001 localhost:9090
  RemoteForward <IP2>:10001 localhost:22

Error we got from the debug.

debug1: Authentication succeeded (publickey).
Authenticated to x.x.x.x ([x.x.x.x]:10022).
debug1: Remote connections from <IP1>:10001 forwarded to local address localhost:22
debug1: Remote connections from <IP2>:10001 forwarded to local address localhost:9090
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: remote forward success for: listen <IP1>:10001, connect localhost:22
debug1: remote forward failure for: listen <IP2>:10001, connect localhost:9090
Error: remote port forwarding failed for listen port 10001

Any ideas?

in flag
Have you checked server for issues (the logs on server)? Maybe the port is already in use? Oh, wait you are using the same port twice!?
tengatoise avatar
jp flag
Yes but on different IPs. It worked in the cli but when using the ssh config. It throwing that error.
in flag
And the server logs? Have you verified that there is nothing already listening on that port? And the commandline still works? and it actually does listen and forward the expected traffic via that ssh session and not some other session?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.