bash - I am trying to execute the python script on remote server using SSH but fails -


script below

client = paramiko.sshclient() client.load_host_keys('/user/hokale')          client.set_missing_host_key_policy(paramiko.autoaddpolicy()) my_key = paramiko.rsakey.from_private_key_file('/user/hokale') client.connect(hostname=host, username=user, password=password,pkey=my_key) 

the remote script present @ locaton /user/hokale. load_host_keys api or paramiko.rsakey.from_private_key_file fails saying

in load     open(filename, 'r') f: filenotfounderror: [errno 2] no such file or directory:/user/hokale 

please suggest solution

i infer question /user/hokale directory "a remote script present @ /user/hokale".

load_host_keys takes filename argument, not directory. if host keys file example /user/hokale/foo/known_hosts, need point file instead of directory.

and remember, paramiko host keys file different ssh known hosts file. typical mistake point ssh known_hosts file , expect work.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -