I work with paramiko, I created my secret key and tried it, which was good. Now I am working with a Django application, where I have already copied the private key in the database.
I saved my private key in charFieldin the Django model. I ran into a problem in the following code:
host = "192.154.34.54"
username = "lovestone"
port = 25
pkey = "------"
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(server, username=username, port=port, pkey=?)
What should I do in this case? How to transfer the private key to SSH.connect, but I saved it stringin the database?
Update
Even I can not use IO, i.e. retrieve the key from the database and write it to a file, and then use the saved file object and go to from_private_key(cls, file_obj, password=None) enter code here, because it is a web application and it is not a shared key. Each user has their own key.