IBM Support

IBM AIX: How to resolve ssh login failure with error 'kex_exchange_identification: sshbuf_putf: invalid argument'

Troubleshooting


Problem

The AIX® ssh client cannot authenticate to SSH servers with passwordless authentication and fails with the error "kex_exchange_identification: sshbuf_putf: invalid argument". Separately, when used to generate a public/private key pair, the ssh-keygen command fails to write the public key to the .pub file.

Cause

The failures occur when the XPG_UNIX98 environment variable is set to "ON".
The XPG_UNIX98 environment variable determines the UNIX standards used by various system functions. When it is not set, or is set to "OFF", the ssh and ssh-keygen commands work because AIX uses the UNIX 03 standard. When it is set to "ON", these commands fail because they cannot process the user's key files due to a difference in the behavior of the vsnprintf function.

Diagnosing The Problem

Check whether the XPG_UNIX98 environment variable is set to "ON", whether in /etc/environment or the user's .profile.

Resolving The Problem

Unset the XPG_UNIX98 environment variable or set it to "OFF".
If the ssh-keygen command previously failed to produce a valid public key file, generate a new public/private key pair.
If the user's public/private key pair is valid, the ssh command no longer fails with an "invalid argument" error.

SUPPORT:

If the instructions in this document do not lead to resolution of the problem, follow these instructions to open a case.  The product must be under warranty or have an active and valid support contract.

a.  Document or take screen captures of all symptoms, errors, or messages.

b.  Capture any logs or data relevant to the issue.

c.  Contact IBM® to open a case.

   -For electronic support, visit the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, visit this web page:
      https://www.ibm.com/planetwide/

d.  Provide a detailed description of the issue and reference this technote.

e.  Upload all of the details and data to the case.

   -You can attach files to the case in the IBM Support Community, or
   -Upload data to IBM test case server analysis at this URL:

    http://www.ibm.com/support/docview.wss?uid=ibm10733581

f.  Click here to submit feedback for this document.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
02 July 2021

UID

ibm16469523