0

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 no-more-sessions@openssh.com
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?

  • 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!? – NiKiZe Jul 14 '21 at 15:21
  • Yes but on different IPs. It worked in the cli but when using the ssh config. It throwing that error. – tengatoise Jul 14 '21 at 15:32
  • 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? – NiKiZe Jul 14 '21 at 15:39

0 Answers0