0

Objective is to connect to Linux server from jumphost using python paramiko/jumpssh, then perform some operations. From jumphost to other linux hosts, need to connect using Passwordless authentication.Please find the code below.

from jumpssh import SSHSession
# establish ssh connection between your local machine and the jump server
gateway_session = SSHSession('10.1.2.3','user1',
                                                  password='pwd123').open()
# from jump server, establish connection with a remote server
# Since it's a passwordless authentication, I'm providing password=None.
remote_session = gateway_session.get_remote_session('10.4.5.6','user1',password=None)
print(gateway_session.get_cmd_output('echo "test" && hostname '))
print(remote_session.get_cmd_output('sudo yum check-update'))
exit()

Output -

No authentication methods available

Please help me to get it through!!!

  • https://stackoverflow.com/questions/48112246/passwordless-ssh-using-paramiko – Quantum Dreamer Nov 16 '20 at 06:10
  • Dear Martin Prikryl, Thanks for your response. You're exactly correct, we are using public key authentication which is stored in /.ssh/id_rsa.pub path of jumphost. – Vishnu220 Nov 17 '20 at 02:48

0 Answers0