Failed to connect to 127.0.0.1 using ParamikoMachine/SshMachine in plumbum

Suresh Kota Source

I have the following code to connect to 127.0.0.1 using ParamikoMachine in plumbum.machines and it is failing.

from plumbum.machines.paramiko_machine import ParamikoMachine
from rpyc.utils.zerodeploy import DeployedServer

ip_addr = "127.0.0.1"

# create the deployment
mach = ParamikoMachine(ip_addr, user="root", password="password")

server = DeployedServer(mach)

Traceback:

Traceback (most recent call last): File "zerodeploy_rpyc_test.py", line 14, in mach = ParamikoMachine(ip_addr, user="root", password="password") File "/home/user/venv/lib/python3.5/site-packages/plumbum/machines/paramiko_machine.py", line 205, in init self._client.connect(host, **kwargs) File "/home/user/venv/lib/python3.5/site-packages/paramiko/client.py", line 402, in connect self, server_hostkey_name, server_key File "/home/user/venv/lib/python3.5/site-packages/paramiko/client.py", line 768, in missing_host_key 'Server {!r} not found in known_hosts'.format(hostname) paramiko.ssh_exception.SSHException: Server '127.0.0.1' not found in known_hosts

Is there a way to add missing_host_key similar to paramiko's set_missing_host_key_policy(paramiko.AutoAddPolicy()) in ParamikoMachine as well? Any ideas on how to resolve this error!!

python-3.xparamikoplumbum

Answers

comments powered by Disqus