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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -