Hi nopes,
hier der Output
Code:
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ## SSH Connect Variables
... import os
>>> import paramiko
>>> WorkHome = os.environ.get("HOME")
>>> SshUser = 'vnz'
>>> SshTarget = 'localhost'
>>> SshFile = WorkHome + '/.ssh/id_rsa'
>>> SshKeyFile = paramiko.RSAKey.from_private_key_file(SshFile)
>>>
>>>
>>> ssh = paramiko.SSHClient()
>>> ssh.load_system_host_keys()
>>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
>>> sftp = ssh.open_sftp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/paramiko/client.py", line 379, in open_sftp
return self._transport.open_sftp_client()
AttributeError: 'NoneType' object has no attribute 'open_sftp_client'
>>> ssh.connect(SshTarget, username=SshUser, pkey=SshKeyFile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/paramiko/client.py", line 307, in connect
look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
File "/usr/lib/python3/dist-packages/paramiko/client.py", line 519, in _auth
raise saved_exception
File "/usr/lib/python3/dist-packages/paramiko/client.py", line 500, in _auth
allowed_types = self._transport.auth_publickey(username, key)
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 1232, in auth_publickey
return self.auth_handler.wait_for_response(my_event)
File "/usr/lib/python3/dist-packages/paramiko/auth_handler.py", line 208, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.
>>>
Lesezeichen