我通过ssh远程使用服务器,并通过ssh隧道使用jupyter。我通常可以使用以下方法来使其工作:
#!/bin/sh
sudo fuser -k 8881/tcp
echo 'Port 8881 is free now'
ssh -N -f -L localhost:8881:localhost:8888 myuser@serveraddress
read -p "Press enter to continue"
ssh myuser@serveraddress "sudo nohup jupyter notebook --no-browser"
wait
chromium http://localhost:8881/;sleep 1; exec bash &
但是,我不知道为什么,经过一些更新并使用以下命令杀死了一些端口:
sudo fuser -k 8891/tcp
我在其他端口也这样做的地方。
我尝试过命令(重新打开):
sudo ufw allow 8891/tcp
但是现在尝试远程使用Jupyter时,我得到以下输出:
sudo: no tty present and no askpass program specified
[8893:9160:0918/214007.129058:ERROR:token_service_table.cc(140)] Failed to decrypt token for service AccountId-114438117936628626704
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
Fontconfig error: Cannot load default config file
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
并且无法再启动Jupyter。有人可以帮我吗?谢谢!
消息:“ sudo:不存在tty且未指定askpass程序”我已解决了此问题,但似乎不是问题所在(即使之前有警告,也是如此)。
更新: 我再次在-v -v中运行它:
sudo: no tty present and no askpass program specified
Gtk-Message: 06:53:32.627: Failed to load module "canberra-gtk-module"
Gtk-Message: 06:53:32.629: Failed to load module "canberra-gtk-module"
[13654:13926:0919/065333.068363:ERROR:token_service_table.cc(140)] Failed to decrypt token for service AccountId-114438117936628626704
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 7 setting TCP_NODELAY
debug2: fd 7 setting O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37178 to ::1 port 8881, nchannels 4
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37180 to ::1 port 8881, nchannels 3
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37184 to ::1 port 8881, nchannels 3
Fontconfig error: Cannot load default config file
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 7 setting TCP_NODELAY
debug2: fd 7 setting O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37186 to ::1 port 8881, nchannels 4
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37188 to ::1 port 8881, nchannels 3
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37190 to ::1 port 8881, nchannels 3
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 7 setting TCP_NODELAY
debug2: fd 7 setting O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37194 to ::1 port 8881, nchannels 4
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37196 to ::1 port 8881, nchannels 3
debug1: Connection to port 8881 forwarding to localhost port 8888 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 8881 for localhost port 8888, connect from ::1 port 37198 to ::1 port 8881, nchannels 3
UPDATE2:我可以使用另一台PC进行访问。