这可以通过使用
jumpssh
代码如下:
>>> from jumpssh import SSHSession
# establish ssh connection between your local machine and the jump server
>>> gateway_session = SSHSession('gateway.example.com',
... 'my_user_1', password='my_password_1').open()
# from jump server, establish connection with a remote server
>>> remote_session = gateway_session.get_remote_session('remote.example.com', 'my_user_2', password='my_password_2')
remote.example.com
使用密码。
我找不到一个办法,我们怎么能联系到
remote.example.com
无需简单密码
ssh remote.example.com
gateway.example.com
当我传递命令时:
ssh gateway.example.com
使用jumpssh,我得到错误:
身份验证失败,需要用户名和密码
或者可以使用Python中的其他模块吗?