21

I am connecting to a data cluster and following these steps:

(I obviously have my .ssh/config file set up properly)

  1. Open the tunnel

  2. SSH into the cluster

  3. Try to bind a port to the server so I can use a Jupyter notebook through this command: ssh -N -L 22127:localhost:22127 [cluster_name]

  4. Run the ipython command on the cluster through: ipython notebook --ip=127.0.0.1 --port=22127 --no-browser

In the end, on step 3, I always get a "Bad local forwarding error". Please note that I have people next to me who have the exact same commands and configurations on the .ssh/config file and can connect and run the Jupyter server.

codeforester
  • 39,467
  • 16
  • 112
  • 140
PL-RL
  • 427
  • 2
  • 7
  • 13
  • What is the complete error message that you get at step 3? Please [edit] your question. – Kenster Mar 12 '18 at 14:19
  • @Kenster is it exactly `Bad local forwarding specification '22127:localhost:22127 [cluster_name]' ` – PL-RL Mar 12 '18 at 14:20
  • 6
    I encountered this `Bad local forwarding specification` error and then solved it. The reason is some character in the command was of wrong encoding. In my case it was a blank space `\xc2\xa0`. Hope this comment could shine some light of somebody else who also encounters the same problem. – AnnieFromTaiwan Aug 20 '19 at 03:02
  • @PL-RL the ` [cluster_name]` should not be appearing in the error message. This suggests that the space between `22127` and `[cluster_name]` is some non-breakeable space that your terminal does not recognize, thus everything is considered one argument. If you copied the command from somewhere, try writing it out yourself – Ciprian Tomoiagă Jan 20 '20 at 15:39

1 Answers1

7

Those both are UTF-8 encoded spaces.

\xc2\xa0
\x0a\x20
   

Make sure you use second one.

Neftanic
  • 930
  • 9
  • 17
  • 1
    My EXACT ISSUE -- i was pasting in a command, had a weird CHAR. Typed it out manually -- all fine! – Jason May 24 '21 at 17:52