AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  sshpass Problem

    Posted Tue March 02, 2021 11:19 AM
    Hello,
    i had installed sshpass-1.06-2.aix6.1.ppc.rpm on AIX 7200-05-01.

    # sshpass -p mypass ssh myuser@foo "date"
    Permission denied, please try again.
    Permission denied, please try again.
    myuser@foo: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).


    Debug output
    sshpass -p mypass ssh -vvv myuser@foo "date"
    <snip>
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
    debug1: Trying private key: /.ssh/id_ecdsa
    debug3: no such identity: /.ssh/id_ecdsa: No such file or directory
    debug1: Trying private key: /.ssh/id_ed25519
    debug3: no such identity: /.ssh/id_ed25519: No such file or directory
    debug1: Trying private key: /.ssh/id_xmss
    debug3: no such identity: /.ssh/id_xmss: No such file or directory
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred: ,password
    debug3: authmethod_is_enabled password
    debug1: Next authentication method: password
    debug1: read_passphrase: can't open /dev/tty: No such device or address
    debug3: send packet: type 50
    debug2: we sent a password packet, wait for reply
    debug3: receive packet: type 51
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
    Permission denied, please try again.
    debug1: read_passphrase: can't open /dev/tty: No such device or address
    debug3: send packet: type 50
    debug2: we sent a password packet, wait for reply
    debug3: receive packet: type 51
    <snip>

    # sum /opt/freeware/bin/sshpass
    59083 65 /opt/freeware/bin/sshpass

    # ls -l /dev/tty
    crw-rw-rw- 1 root system 1, 0 Mar 02 16:46 /dev/tty

    Using the same syntax on RHEL server to AIX works without problem.

    Thanks for help.

    ------------------------------
    Jörg Witzel
    ------------------------------


  • 2.  RE: sshpass Problem

    Posted Tue March 23, 2021 09:09 AM
    Edited by Ayappan P Tue March 23, 2021 09:09 AM
    Please make sure whether you have recent openssh & openssl fileset installed.
    You can get the fileset from AIX web download pack programs --> https://www-01.ibm.com/marketing/iwm/iwm/web/pickUrxNew.do?source=aixbp

    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: sshpass Problem

    Posted Thu April 01, 2021 01:23 AM
    I met the same error, and the lastest openssh 8.1 is installed. But I assume sshpass doesn't pass the password correctly as the log. Would you have any suggestion? Thank you.

    ======================

    Mar 31 06:42:28 nntaix02 auth|security:info sshd[14352414]: Failed password for qzxl from 10.1.25.59 port 11185 ssh2
    Mar 31 06:42:28 nntaix02 auth|security:info syslog: ssh: failed login attempt for qzxl from 10.1.25.59
    Mar 31 06:42:28 nntaix02 auth|security:info sshd[14352414]: Failed password for qzxl from 10.1.25.59 port 11185 ssh2
    Mar 31 06:42:28 nntaix02 auth|security:info syslog: ssh: failed login attempt for qzxl from 10.1.25.59
    Mar 31 06:42:28 nntaix02 auth|security:info sshd[14352414]: Connection closed by authenticating user qzxl 10.1.25.59 port

    ------------------------------
    NNIT UNIXVAGT
    ------------------------------



  • 4.  RE: sshpass Problem

    Posted Thu April 01, 2021 09:19 AM
    Hi,
    I usually use expect, so tried sshpass and saw the same thing using AIX 7.5.2.1. In particular:
    openssh.base.client/server 8.1.102.2101
    openssl.base 1.0.2.2100
    sshpass-1.06-2.ppc
    .
    Saw the same errors on AIX to AIX, AIX to Linux, but Linux to AIX okay
    Turning on debugging on the endpoint
    .
    For vanila ssh providing password:
    Apr 1 08:03:52 ibmpc3 auth|security:info sshd[20971840]: Accepted password for red from 192.168.138.141 port 37767 ssh2
    Apr 1 08:03:52 ibmpc3 auth|security:info sshd[16253414]: Received disconnect from 192.168.138.141 port 37767:11: disconnected by user
    Apr 1 08:03:52 ibmpc3 auth|security:info sshd[16253414]: Disconnected from user red 192.168.138.141 port 37767
    Using sshpass with password (-p -e or -f flags all the same):
    Apr 1 08:04:02 ibmpc3 auth|security:info sshd[20644186]: Failed password for red from 192.168.138.141 port 37772 ssh2
    Apr 1 08:04:02 ibmpc3 auth|security:info syslog: ssh: failed login attempt for red from 192.168.138.141
    Apr 1 08:04:02 ibmpc3 auth|security:info sshd[20644186]: Failed password for red from 192.168.138.141 port 37772 ssh2
    Apr 1 08:04:02 ibmpc3 auth|security:info syslog: ssh: failed login attempt for red from 192.168.138.141
    Apr 1 08:04:02 ibmpc3 auth|security:info sshd[20644186]: Connection closed by authenticating user red 192.168.138.141 port 37772 [preauth]
    .
    I will try next with wireshark to confirm if sshpass is actually sending something and update soon.
    Cheers,

    ------------------------------
    --------------------
    Antony Steel (Red)
    ===============
    ------------------------------



  • 5.  RE: sshpass Problem

    Posted Thu April 08, 2021 06:05 AM
    Hi,
    Nothing stood out in wireshark..
    .
    I found running sshd in debug on a different port, vanila ssh showed
    <snip>
    debug1: kbdint_alloc: devices '' [preauth]^M
    debug1: userauth-request for user red service ssh-connection method password [preauth]^M
    debug1: attempt 3 failures 2 [preauth]^M
    debug1: AIX/loginrestrictions returned 0 msg (none)^M
    Accepted password for red from 192.168.138.141 port 32853 ssh2^M
    debug1: AIX/loginsuccess: msg 4 unsuccessful login attempts since last login.
    Last unsuccessful login: Thu Apr 8 04:20:09 CDT 2021 on ssh from 192.168.138.141
    <\snip>
    .
    and with sshpass, similar up until
    <snip>
    debug1: kbdint_alloc: devices '' [preauth]^M
    debug1: userauth-request for user red service ssh-connection method password [preauth]^M
    debug1: attempt 3 failures 2 [preauth]^M
    Failed none for red from 192.168.138.141 port 32860 ssh2^M
    <\snip>
    .
    I downloaded version 1.09 from github and found the same error.
    .
    Sorry, will try a few other debugging options.
    Cheers,

    ------------------------------
    --------------------
    Antony Steel (Red)
    ===============
    ------------------------------