I can connect to postgres server as below
self.ssh = paramiko.SSHClient()
self.ssh.load_system_host_keys()
self.ssh.connect('hostname', username='uname')
But I have to connect to another server after I connect to first one. So in terminal
- first:
ssh uname@hostname
- second:
ssh uname2@hostname@
(in server 1)
How do I this in python code? I tried
self.ssh = paramiko.SSHClient()
self.ssh.load_system_host_keys()
self.ssh.connect('hostname', username='uname')
self.ssh.connect('hostname2', username='uname2')
But this doesn't work
I tried to use transport but couldn't get concept clear