python - How to send password while using ssh command in os.system? -


for example, have code below:

cmd = "ssh <host>" os.system(cmd) 

how can send password in python script don't have type password every time?

use paramiko, so:

sh = paramiko.sshclient() sh.connect(server, username=username, password=password) 

there many demos in paramiko github repo.


Comments

Popular posts from this blog

c++ - rosrun via ssh doesnt start a node properly -

android - questions about switching from C2DM to GCM -

How to resolve Delphi error: Incompatible types: 'PWideChar' and 'Pointer' -