<h2>SSH authentication failing after upgrade</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul><li>SSH authentication started failing post Quebec upgrade<br /><br /></li><li>Error observed on the MID as below<br /><br /><em>LogStatusMonitor.60 DEBUG: Event: OneMinuteEvent&#13;</em><br /><em>Worker-Interactive:CommandPipeline-491028e51b366010f29aedf1b24bcb93 DEBUG: SSHSessionFactory: connection failed authentication for key SSHSessionPoolKey[target:10.80.48.48&amp;port:22&amp;fixed_cred:&amp;tag:&amp;unique_id:8d10202157322010fc39b8efe34ee9ba&amp;privilegedCommand:sudo&amp;passwordPrompt:&amp;debug:false&amp;useSeperateSession: false&amp;updateIndex: 2&amp;disablePrivilegeCheck: false&amp;cipherAlgorithms: aes128-ctr,aes192-ctr,aes256-ctr,3des-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc&amp;hostKeyAlgorithms: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa,ssh-dss&amp;kexAlgorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,rsa2048-sha256,rsa1024-sha1&amp;macAlgorithms: hmac-sha2-256,hmac-sha1,hmac-sha2-512,hmac-sha1-96,hmac-md5-96,hmac-md5] with credential SSH_ZENOSS&#13;</em><br /><em>Worker-Interactive:CommandPipeline-491028e51b366010f29aedf1b24bcb93 DEBUG: SSHSessionFactory: Authentication failure. Blacklisting key SSHSessionPoolKey[target:10.80.48.48&amp;port:22&amp;fixed_cred:&amp;tag:&amp;unique_id:8d10202157322010fc39b8efe34ee9ba&amp;privilegedCommand:sudo&amp;passwordPrompt:&amp;debug:false&amp;useSeperateSession: false&amp;updateIndex: 2&amp;disablePrivilegeCheck: false&amp;cipherAlgorithms: aes128-ctr,aes192-ctr,aes256-ctr,3des-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc&amp;hostKeyAlgorithms: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa,ssh-dss&amp;kexAlgorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,rsa2048-sha256,rsa1024-sha1&amp;macAlgorithms: hmac-sha2-256,hmac-sha1,hmac-sha2-512,hmac-sha1-96,hmac-md5-96,hmac-md5]&#13;</em><br /></li></ul></section></div><div ><h3 >Release</h3><section><ul><li>Quebec</li></ul></section></div><div ><h3 >Resolution</h3><section><ul><li>There are two types of keys "<strong>Host key</strong>" and "<strong>User key</strong>".<br /><br /></li><li>The "<strong>Host key</strong>" is a unique key for each host and the algorithm used is known host key algorithms. This algorithm list is shared with both client and server during SSH handshake, and come up with an algorithm that both sides agree.<br /><br /></li><li>The "<strong>User key</strong>" is provided for each user, and may be different from the negotiated host key algorithm. When ssh client gets authenticated by the server, it would first check if host key is valid, and then check for user key.<br /><br /></li><li>The reason of why behavior changed in "Quebec" is that :<br /><br /> <ul><li>Before Quebec: <strong>snc_ssh</strong> checks the presented key match with a host key algorithm that client supports and use it.<br /><br /></li><li>After Quebec: <strong>snc_ssh</strong> looks for if presented key match a host key algorithm that both client and server supports. If no algorithm is found, the connection would fail.<br /><br /></li></ul> </li><li>This was changed because we try to follow the RFC standard as below<br /><br /> <ul><li>Any public key algorithm may be offered for use in authentication. In particular, the list is not constrained by what was negotiated during key exchange. If the server does not support some algorithm, it MUST simply reject the request.<br /><br /></li></ul> </li><li>Due to this code change, when a server (target) does not have <strong>ssh-dss</strong> in host key algorithm and when the MID connects to this server under a user (with <strong>ssh-dss</strong> as user key), the connection would fail.<br /><br /></li><li>In spite of providing the fix, there are two workarounds to mitigate the situation:<br /><br /> <ul><li>Upgrade the "<strong>User key</strong>" to a stronger algorithm as it is the recommended way by OpenSSH officials.<br /><br /></li><li>If the upgrade cannot be done, we may try an alternative, that is generating a <strong>ssh-dss</strong> host key, so that the <strong>ssh-dss</strong> would be included in the host key algorithm that the server supports. This can be done as<br /><br /> <ul><li>Generate a <strong>ssh-dss</strong> host key under <em><strong>/etc/ssh/</strong></em>, similar to other keys that were generated during installation<br /><br /></li><li>Add "<em><strong>HostKeyAlgorithms=+ssh-dss</strong></em>" in <em><strong>/etc/ssh/sshd_config</strong></em> to enable server to use <strong>ssh-dss</strong> for some newer <strong>sshd</strong> version, since it was disabled / deprecated by default.<br /><br /></li></ul> </li></ul> </li></ul></section></div></article></div>