I have .ppk file and I am using paramiko module to create connection but it return me error,
Here is my code
import paramiko
hostname = 'sftp.xyz.eu'
myuser = 'myusername'
mySSHK = 'file.ppk'
password = '9SMxT2rAsybsLWt'
sshcon = paramiko.SSHClient() # will create the object
sshcon.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # no known_hosts error
sshcon.connect(hostname, username = myuser, password = password, key_filename = mySSHK)
print(sshcon)
it return me this erorr please correct me
sshcon.connect(hostname, username = myuser, password = password, key_filename = mySSHK)
File "/home/test/Documents/xml_read_ftp/paramiko/client.py", line 446, in connect
passphrase,
File "/home/test/Documents/xml_read_ftp/paramiko/client.py", line 764, in _auth
raise saved_exception
paramiko.ssh_exception.SSHException: No existing session
Now i have convert my file with public_key with puty
Now i am getting this error
self, server_hostkey_name, server_key
File "/home/test/Documents/xml_read_ftp/paramiko/client.py", line 824, in missing_host_key
paramiko.ssh_exception.SSHException: Server 'sftp.xyz.xyz' not found in known_hosts