I want to send a command over ssh with python
from paramiko import SSHClient ssh = SSHClient() ssh.load_system_host_keys() ssh.connect("192.168.0.62",port="22", username="username", password="password") And when i run it I get this
File "prog.py", line 8, in <module> ssh.connect("192.168.0.62",port="22", username="username", password="password") File "/home/rick/.local/lib/python2.7/site-packages/paramiko/client.py", line 416, in connect self, server_hostkey_name, server_key File "/home/rick/.local/lib/python2.7/site-packages/paramiko/client.py", line 824, in missing_host_key "Server {!r} not found in known_hosts".format(hostname) paramiko.ssh_exception.SSHException: Server '[192.168.0.62]:22' not found in known_hosts What should i do
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())this is not a good way during security concerns.