在远程linux机器上安装了Anaconda Python。
在本地Windows上使用 putty 登录远程linux机器以远程启动Ipython Notebook。它始于8888号端口。
remote_user @ remote_host $ ipython notebook --no-browser --port = 8888
现在我需要在本地浏览器上访问此Notebook。 尝试过做ssh隧道。
C:\ Users \用户的 windowsUser > ssh -N -f -L localhost:8888:localhost:8888 remote_user @ remote_host
ssh:连接到主机remote_host端口22:文件号错误
但无法做到正确。得到上述错误
注意:remote_host(linux)上不存在用户 windowsUser 。远程用户帐户是remote_user。
我哪里错了? Plzz帮助
答案 0 :(得分:1)
看来你有一个错字。在你的ssh命令中,你不应该有两次“localhost”。
更正的命令是:
ssh -N -f -L 8888:localhost:8888 remote_user@remote_host
因为命令的语法是:
ssh -L <Local Port>:<Local Machine>:<Target Port> <Target Machine>
(见http://www.slashroot.in/ssh-port-forwarding-linux-configuration-and-examples)
此外,您可以改为修改ssh配置文件(在~/.ssh/config
或/etc/ssh_config
中)以包含端口转发:
Host remote_host
Hostname PUT_REMOTE_IP_HERE
Port 22
User remote_user
LocalForward 8888 localhost:8888
答案 1 :(得分:0)
我认为窗口没有ssh cmd,
如果local是标准的ssh客户端使用
C:\Users\windowsUser> ssh -N -f -L 8888:localhost:8888 remote_user@remote_host
ipython notebook --ip=remote_host_ip