Skip to content

[Bug]free_space plugin incorrectly uses password instead of key pair to access remote server #3323

@shangyexin

Description

@shangyexin

Expected behaviour:

flexget can get the remaining space of the remote server

Actual behaviour:

flexget failed to get the remaining space of the remote server because the password was used instead of the public key to connect

Steps to reproduce:

  • Step 1: use free_space plugin to get the remaining space of the remote server

Config:

free_space:
  path: '/remote/location/to/monitor'
  space: 5000
  host: 'unique.hostingcompany.com'
  user: 'remote_username'
  ssh_key_filepath: /home/local_username/.ssh/id_rsa

Log:

(click to expand)
2022-01-21 20:12:24 DEBUG    paramiko.transport                 starting thread (client mode): 0x36f0ee20
2022-01-21 20:12:24 DEBUG    paramiko.transport                 Local version/idstring: SSH-2.0-paramiko_2.9.2
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Remote version/idstring: SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
2022-01-21 20:12:25 INFO     paramiko.transport                 Connected (version 2.0, client OpenSSH_8.2p1)
2022-01-21 20:12:25 DEBUG    paramiko.transport                 === Key exchange possibilities ===
2022-01-21 20:12:25 DEBUG    paramiko.transport                 kex algos: curve25519-sha256, curve25519-sha256@libssh.org, 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
2022-01-21 20:12:25 DEBUG    paramiko.transport                 server key: rsa-sha2-512, rsa-sha2-256, ssh-rsa, ecdsa-sha2-nistp256, ssh-ed25519
2022-01-21 20:12:25 DEBUG    paramiko.transport                 client encrypt: chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com
2022-01-21 20:12:25 DEBUG    paramiko.transport                 server encrypt: chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com
2022-01-21 20:12:25 DEBUG    paramiko.transport                 client mac: umac-64-etm@openssh.com, umac-128-etm@openssh.com, hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-64@openssh.com, umac-128@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1
2022-01-21 20:12:25 DEBUG    paramiko.transport                 server mac: umac-64-etm@openssh.com, umac-128-etm@openssh.com, hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-64@openssh.com, umac-128@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1
2022-01-21 20:12:25 DEBUG    paramiko.transport                 client compress: none, zlib@openssh.com
2022-01-21 20:12:25 DEBUG    paramiko.transport                 server compress: none, zlib@openssh.com
2022-01-21 20:12:25 DEBUG    paramiko.transport                 client lang: <none>
2022-01-21 20:12:25 DEBUG    paramiko.transport                 server lang: <none>
2022-01-21 20:12:25 DEBUG    paramiko.transport                 kex follows: False
2022-01-21 20:12:25 DEBUG    paramiko.transport                 === Key exchange agreements ===
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Kex: curve25519-sha256@libssh.org
2022-01-21 20:12:25 DEBUG    paramiko.transport                 HostKey: ssh-ed25519
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Cipher: aes128-ctr
2022-01-21 20:12:25 DEBUG    paramiko.transport                 MAC: hmac-sha2-256
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Compression: none
2022-01-21 20:12:25 DEBUG    paramiko.transport                 === End of kex handshake ===
2022-01-21 20:12:25 DEBUG    paramiko.transport                 kex engine KexCurve25519 specified hash_algo <built-in function openssl_sha256>
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Switch to new keys ...
2022-01-21 20:12:25 DEBUG    paramiko.transport chdbits         Adding ssh-ed25519 host key for [xxx.xxx.xxx.xxx]:xxx: b'43ad06e3a691d5fd19c9d94d9ed84994'
2022-01-21 20:12:25 DEBUG    paramiko.transport                 Got EXT_INFO: {'server-sig-algs': b'ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com'}
2022-01-21 20:12:26 DEBUG    paramiko.transport                 userauth is OK
2022-01-21 20:12:30 INFO     paramiko.transport                 Authentication (password) failed.
2022-01-21 20:12:30 ERROR    free_space    chdbits         Issue connecting to remote host. Authentication failed.
2022-01-21 20:12:30 WARNING  task          chdbits         Aborting task (plugin: free_space)
2022-01-21 20:12:30 DEBUG    backlog       chdbits         Remembering all entries to backlog because of task abort.

Additional information:

  • FlexGet version: 3.2.8
  • Python version: 3.9.5
  • Installation method: docker
  • Using daemon (yes/no): no
  • OS and version: Alpine 3.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions