Python Forum
Paramiko SSH Session -> Authentification failed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paramiko SSH Session -> Authentification failed
i am new in Python and in this forum.
For my work i need an SSH Connection to an Ethernet NT from different Company. The Goal should be the automatically Configuration of this NT.
This Ethernet NT allows only SSH Connection via User/Password.
As SSH Client I prefer Paramiko. Following easy Code Snippet:
sh = paramiko.SSHClient()
ssh.connect(host, port, username, password)

if ssh.get_transport() is not None:
    print("Not Connected")
This Connection works to connect to my linux Server. If I try to connect to this Ethernet NT, following Error Message appears:

paramiko.ssh_exception.AuthenticationException: Authentication failed.
User and Password are correct.

I receive following debug from Paramiko:
DEB [20210228-17:56:23.861] thr=1   paramiko.transport: starting thread (client mode): 0xd0beb2e0
DEB [20210228-17:56:23.861] thr=1   paramiko.transport: Local version/idstring: SSH-2.0-paramiko_2.7.2
DEB [20210228-17:56:23.881] thr=1   paramiko.transport: Remote version/idstring: SSH-2.0-OpenSSH_7.4
INF [20210228-17:56:23.881] thr=1   paramiko.transport: Connected (version 2.0, client OpenSSH_7.4)
DEB [20210228-17:56:23.884] thr=1   paramiko.transport: kex algos:['curve25519-sha256', '[email protected]', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group16-sha512', 'diffie-hellman-group18-sha512', 'diffie-hellman-group14-sha256', 'diffie-hellman-group14-sha1'] server key:['ssh-rsa', 'rsa-sha2-512', 'rsa-sha2-256'] client encrypt:['[email protected]', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] server encrypt:['[email protected]', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', '[email protected]', '[email protected]'] client mac:['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'] server mac:['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'] client compress:['none', '[email protected]'] server compress:['none', '[email protected]'] client lang:[''] server lang:[''] kex follows?False
DEB [20210228-17:56:23.885] thr=1   paramiko.transport: Kex agreed: [email protected]
DEB [20210228-17:56:23.885] thr=1   paramiko.transport: HostKey agreed: ssh-rsa
DEB [20210228-17:56:23.885] thr=1   paramiko.transport: Cipher agreed: aes128-ctr
DEB [20210228-17:56:23.885] thr=1   paramiko.transport: MAC agreed: hmac-sha2-256
DEB [20210228-17:56:23.885] thr=1   paramiko.transport: Compression agreed: none
DEB [20210228-17:56:23.970] thr=1   paramiko.transport: kex engine KexCurve25519 specified hash_algo <built-in function openssl_sha256>
DEB [20210228-17:56:23.971] thr=1   paramiko.transport: Switch to new keys ...
DEB [20210228-17:56:23.973] thr=2   paramiko.transport: Adding ssh-rsa host key for b'f2aa0b52eaf68face2c79cd56ffe880e'
DEB [20210228-17:56:23.976] thr=1   paramiko.transport: userauth is OK
INF [20210228-17:56:23.986] thr=1   paramiko.transport: Authentication (password) failed.
DEB [20210228-17:56:23.996] thr=1   paramiko.transport: EOF in transport thread
Tried this via PuTTY und commandline. Also here the password is not working automatically. The Passwort request is shown.
I am wondering if there is any special SSH implementation.

Is it possible to send the password as input in an inactive SSH Connection over Paramiko.
Have anyone any Ideas to login in the Device Wall

Best Regards,

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to keep paramiko ssh session open after loggin in using python? MikeHill 3 8,772 Aug-15-2017, 06:55 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020