如果您使用这一小段代码:
import sshtunnel
# The IP of any system with an SSH server on port 22
ip = "localhost"
print "Connecting to ssh..."
with sshtunnel.open_tunnel(ip, ssh_username="test",
ssh_password="test",
remote_bind_address=("1.2.3.4", 23)) as server:
print "SSH connected"
print "SSH Closed"
将“ip”变量设置为在端口22上运行SSH服务器的任何系统,运行代码,并在打印“正在连接到ssh ...”后尝试使用Ctrl + C中断它,它将给你追溯并冻结(不退出)。 是什么阻碍了它?
答案 0 :(得分:1)
目前DF$a
没有考虑任何信号。
您可以通过运行以下方法解决:
sshtunnel