Reputation: 367
Have installed Anaconda Python on remote linux machine.
Used putty on local Windows to login to remote linux machine to remotely start the Ipython Notebook. It's started on port 8888.
remote_user@remote_host$ ipython notebook --no-browser --port=8888
Now I need to access this Notebook on local browser. Have tried doing ssh tunnel.
C:\Users\windowsUser> ssh -N -f -L localhost:8888:localhost:8888 remote_user@remote_host
ssh: connect to host remote_host port 22: Bad file number
But not able to get it right. Getting the above error
Note: the user windowsUser does not exist on remote_host(linux). Remote user account is remote_user.
Where am i going wrong? Plzz help
Upvotes: 0
Views: 2604
Reputation:
I don't think window has a ssh cmd,
if local is a standard ssh client use
C:\Users\windowsUser> ssh -N -f -L 8888:localhost:8888 remote_user@remote_host
ipython notebook --ip=remote_host_ip
then you can access with http://remote_host_ip:8888/tree
Upvotes: 0
Reputation: 600
It appears you have a typo. In your ssh command you should not have "localhost" twice.
The corrected command is:
ssh -N -f -L 8888:localhost:8888 remote_user@remote_host
Because the syntax for the command is:
ssh -L <Local Port>:<Local Machine>:<Target Port> <Target Machine>
(see http://www.slashroot.in/ssh-port-forwarding-linux-configuration-and-examples)
Furthermore, you could instead modify your ssh config file (in ~/.ssh/config
or /etc/ssh_config
) to include port forwarding:
Host remote_host
Hostname PUT_REMOTE_IP_HERE
Port 22
User remote_user
LocalForward 8888 localhost:8888
Upvotes: 1