| 157 | |
| 158 | |
| 159 | def sn_init_remote_machine(host, username, password): |
| 160 | # transport = paramiko.Transport((host, 22)) |
| 161 | # transport.connect(username=username, password=password) |
| 162 | remote_machine_ssh = paramiko.SSHClient() |
| 163 | # remote_machine_ssh._transport = transport |
| 164 | remote_machine_ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) |
| 165 | |
| 166 | remote_machine_ssh.connect(hostname=host, |
| 167 | port=22, |
| 168 | username=username, |
| 169 | password=password) |
| 170 | transport = paramiko.Transport((host, 22)) |
| 171 | transport.connect(username=username, password=password) |
| 172 | return remote_machine_ssh, transport |
| 173 | # transport.close() |
| 174 | |
| 175 | |
| 176 | def sn_init_remote_ftp(transport): |