Thread: ssh using python and paramiko module
hi all,
first post , new in python , paramiko. requirement to:
- ssh server1.com
- ssh server1 server2.com
- ssh server2 server3.com
- run multiple unix commands on server3.com declog, decrypt, scp, grep etc.... , create .tgz file
- move .tgz file server3 server2 server1 local
did google , found python script paramiko module can job. able ssh server1 don't know how ssh server2 , server3.
appreciate, if can give me guidelines or different approach achieve task.
thanks,code:ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.load_host_keys("/cygwin/home/skhome/.ssh/known_hosts") privkey = paramiko.rsakey.from_private_key_file ("/cygwin/home/skhome/.ssh/id_rsa") ssh.connect('server1.com', username='sk000g',pkey=privkey ) # not sure how connect sever2, server3 , execute unix commands
shah
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [other] ssh using python and paramiko module
Ubuntu
Comments
Post a Comment