Comments (2)
Hi,
I am getting this error:
---------------------------------------------------------------------------
SSHException Traceback (most recent call last)
<ipython-input-1-40609d5a064d> in <module>()
3 ssh = SSHClient()
4 ssh.load_system_host_keys()
----> 5 ssh.connect('XX.XXX.XX.XXX')
C:\Apps\Anaconda3\lib\site-packages\paramiko\client.py in connect(self, hostname, port, username, password, pkey, key_filename, timeout, allow_
agent, look_for_keys, compress, sock, gss_auth, gss_kex, gss_deleg_creds, gss_host, banner_timeout, auth_timeout)
371 # will raise exception if the key is rejected
372 self._policy.missing_host_key(
--> 373 self, server_hostkey_name, server_key
374 )
375 else:
C:\Apps\Anaconda3\lib\site-packages\paramiko\client.py in missing_host_key(self, client, hostname, key)
698 client._log(DEBUG, 'Rejecting %s host key for %s: %s' %
699 (key.get_name(), hostname, hexlify(key.get_fingerprint())))
--> 700 raise SSHException('Server %r not found in known_hosts' % hostname)
701
702
SSHException: Server 'XX.XXX.XX.XXX' not found in known_hosts
when I run:
import paramiko
from scp import SCPClient
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.connect('XX.XXX.XX.XXX')
And even if I add ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
, I get a different type of error:
PasswordRequiredException: Private key file is encrypted
yet my key doesn't have a password, so I can't provide a password as argument to ssh.connect
.
Any ideas of what could be wrong? I thought ssh.load_system_host_keys()
would solve this problem...
Btw, I'm using version paramiko==2.2.1
Thanks for your help.
from scp.py.
Are you sure it is not encrypted? It might be decrypted automatically by your system's wallet using your login password, or something similar.
Please check the file, if it starts with this, then it is encrypted:
$ cat ~/.id_rsa
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,BE44494248DC4AB8AA2E178B11EE2A15
from scp.py.
Related Issues (20)
- scp doesn't check the exit code of the remote command (needed for Windows) HOT 1
- Support streams HOT 3
- exlude some files HOT 1
- remote delete Files after successfully download HOT 1
- Freebsd (Juniper Junos) not happy with extra space in Secure Copy get HOT 2
- Creating directories HOT 1
- Transfer directory HOT 4
- paramiko.ssh_exception.SSHException: Incompatible ssh peer (no acceptable host key) on all tests HOT 1
- Get data into file-like object - getfo HOT 1
- scp does not work with pathlib.PurePath HOT 1
- How do I download multiple files at the same time?
- Permission denied with .put() HOT 10
- Remote wildcard does not work HOT 2
- File not closed in case SocketTimeout occured
- Pass progress callback when calling get/put methods on SCPClient HOT 3
- Retrieve scp errors HOT 6
- add support when both source and target are from remote locations (not necessary the same server)
- Add support for get() to keep downloaded file in memory via a BytesIO object as the "local_file" HOT 1
- Request for enhancement support to download all regular file in case of there is non-regular file under one folder HOT 3
- Using a trailing forward slash in Windows causes problems
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scp.py.