Form the main Linux OS (connected, working) I would like to run another ".connect".
Here is the code:
import paramiko hostname = "hostaname" ip = "1111.111.11.11" username = "user" password = "pass" ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=hostname,username=username, password=password) Now from the main I want to accesses another localhost:
hostname = "localhost" ip = "222.222.2.2" username = "root" password = "root" ssh.connect(hostname=hostname,username=username, password=password) I get the following error:
NoValidConnectionsError: [Errno None] Unable to connect to port 22 on 222.222.2.2 or ::1 UPD: I found my answer in the following question: Nested SSH using Python Paramiko