<div dir="ltr"><div>James,</div><div>What I suggested was not to recompile dropbear for the VPS, but download and compile the same version of dropbear *on your computer* (or whatever is the machine you are using to connect to the VPC from). Then use dbclient instead of ssh to connect to the VPS.</div><div>If you can write on the VPC, another thing you can do is to *cross compile* a newer version of dropbear on your PC using a toolchain for VPS, then install dropbear<br></div><div>Regards,</div><div>Fabrizio</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 28, 2022 at 12:52 AM James Miller <<a href="mailto:gajs-f0el@dea.spamcon.org">gajs-f0el@dea.spamcon.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks to all for your responses and apologies for the delay in <br>
responding. I decided that perhaps including in this response output from <br>
the ssh -v command might be the best way to proceed since answers to some <br>
of the questions asked will be found there. Thus, the following <br>
slightly-obfuscated and commented output:<br>
<br>
### below with key-pair authentication enabled<br>
OpenSSH_9.0p1, OpenSSL 1.1.1p  21 Jun 2022<br>
debug1: Reading configuration data /home/user/.ssh/config<br>
debug1: /home/user/.ssh/config line 6: Applying options for vps<br>
debug1: Reading configuration data /etc/ssh/ssh_config<br>
debug1: Connecting to 12.34.56.78 [12.34.56.78] port 22222.<br>
debug1: Connection established.<br>
debug1: identity file /home/user/.ssh/MyMachine.id.rsa type 0<br>
debug1: identity file /home/user/.ssh/MyMachine.id.rsa-cert type -1<br>
debug1: Local version string SSH-2.0-OpenSSH_9.0<br>
debug1: Remote protocol version 2.0, remote software version dropbear_2017.75<br>
debug1: compat_banner: no match: dropbear_2017.75<br>
debug1: Authenticating to <a href="http://12.34.56.78:22222" rel="noreferrer" target="_blank">12.34.56.78:22222</a> as 'user'<br>
debug1: load_hostkeys: fopen /home/user/.ssh/known_hosts2: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>
debug1: SSH2_MSG_KEXINIT sent<br>
debug1: SSH2_MSG_KEXINIT received<br>
debug1: kex: algorithm: <a href="mailto:curve25519-sha256@libssh.org" target="_blank">curve25519-sha256@libssh.org</a><br>
debug1: kex: host key algorithm: ssh-rsa<br>
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none<br>
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none<br>
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY<br>
debug1: SSH2_MSG_KEX_ECDH_REPLY received<br>
debug1: Server host key: ssh-rsa SHA256:<alphanumeric string w special chars here><br>
debug1: load_hostkeys: fopen /home/user/.ssh/known_hosts2: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>
debug1: Host '[12.34.56.78]:22222' is known and matches the RSA host key.<br>
debug1: Found key in /home/user/.ssh/known_hosts:95<br>
debug1: rekey out after 4294967296 blocks<br>
debug1: SSH2_MSG_NEWKEYS sent<br>
debug1: expecting SSH2_MSG_NEWKEYS<br>
debug1: SSH2_MSG_NEWKEYS received<br>
debug1: rekey in after 4294967296 blocks<br>
debug1: get_agent_identities: bound agent to hostkey<br>
debug1: get_agent_identities: agent returned 1 keys<br>
debug1: Will attempt key: /home/user/.ssh/MyMachine.id.rsa RSA SHA256:<long alphanumeric string here> explicit agent<br>
debug1: SSH2_MSG_SERVICE_ACCEPT received<br>
debug1: Authentications that can continue: publickey<br>
debug1: Next authentication method: publickey<br>
debug1: Offering public key: /home/user/.ssh/MyMachine.id.rsa RSA <br>
SHA256:<long alphanumeric sequence here> explicit agent<br>
debug1: send_pubkey_test: no mutual signature algorithm<br>
debug1: No more authentication methods to try.<br>
<a href="mailto:user@12.34.56.78" target="_blank">user@12.34.56.78</a>: Permission denied (publickey).<br>
<br>
### below with key-pair authentication disabled (no -s switch under <br>
/etc/default/dropbear config file)<br>
OpenSSH_9.0p1, OpenSSL 1.1.1p  21 Jun 2022<br>
debug1: Reading configuration data /home/user/.ssh/config<br>
debug1: /home/user/.ssh/config line 6: Applying options for vps<br>
debug1: Reading configuration data /etc/ssh/ssh_config<br>
debug1: Connecting to 12.34.56.78 [12.34.56.78] port 22222.<br>
debug1: Connection established.<br>
debug1: identity file /home/user/.ssh/MyMachine.id.rsa type 0<br>
debug1: identity file /home/user/.ssh/MyMachine.id.rsa-cert type -1<br>
debug1: Local version string SSH-2.0-OpenSSH_9.0<br>
debug1: Remote protocol version 2.0, remote software version dropbear_2017.75<br>
debug1: compat_banner: no match: dropbear_2017.75<br>
debug1: Authenticating to <a href="http://12.34.56.78:22222" rel="noreferrer" target="_blank">12.34.56.78:22222</a> as 'user'<br>
debug1: load_hostkeys: fopen /home/user/.ssh/known_hosts2: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>
debug1: SSH2_MSG_KEXINIT sent<br>
debug1: SSH2_MSG_KEXINIT received<br>
debug1: kex: algorithm: <a href="mailto:curve25519-sha256@libssh.org" target="_blank">curve25519-sha256@libssh.org</a><br>
debug1: kex: host key algorithm: ssh-rsa<br>
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none<br>
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none<br>
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY<br>
debug1: SSH2_MSG_KEX_ECDH_REPLY received<br>
debug1: Server host key: ssh-rsa SHA256:<alphanumeric string w special chars here><br>
debug1: load_hostkeys: fopen /home/user/.ssh/known_hosts2: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>
debug1: Host '[12.34.56.78]:22222' is known and matches the RSA host key.<br>
debug1: Found key in /home/user/.ssh/known_hosts:95<br>
debug1: rekey out after 4294967296 blocks<br>
debug1: SSH2_MSG_NEWKEYS sent<br>
debug1: expecting SSH2_MSG_NEWKEYS<br>
debug1: SSH2_MSG_NEWKEYS received<br>
debug1: rekey in after 4294967296 blocks<br>
debug1: get_agent_identities: bound agent to hostkey<br>
debug1: get_agent_identities: agent returned 1 keys<br>
debug1: Will attempt key: /home/user/.ssh/MyMachine.id.rsa RSA SHA256:<long alphanumeric string here> explicit agent<br>
debug1: SSH2_MSG_SERVICE_ACCEPT received<br>
debug1: Authentications that can continue: publickey,password<br>
debug1: Next authentication method: publickey<br>
debug1: Offering public key: /home/user/.ssh/MyMachine.id.rsa RSA <br>
SHA256:<long alphanumeric sequence here> explicit agent<br>
debug1: send_pubkey_test: no mutual signature algorithm<br>
debug1: Next authentication method: password<br>
<a href="mailto:user@12.34.56.78" target="_blank">user@12.34.56.78</a>'s password<br>
<br>
I have an ~/.ssh config and I do have stipulated there under the vps entry <br>
HostkeyAlgorithms +ssh-rsa and PubkeyAcceptedAlgorithms +ssh-rsa, as can <br>
be seen below:<br>
<br>
Host vps<br>
Hostname 12.34.56.78<br>
Port 22222<br>
KexAlgorithms +diffie-hellman-group1-sha1<br>
HostKeyAlgorithms +ssh-rsa<br>
IdentityFile /home/user/.ssh/MyMachine.id.rsa<br>
<br>
I did recently install on the client system keychain, since I had <br>
generated a new ecdsa (ed25519) key set on this machine for other <br>
purposes. keychain has not been configured to save that key in memory, <br>
but rather the rsa key stipulated in the config.<br>
<br>
I suppose the quick and sure-fire way to address the issue I'm having <br>
would be to generate new keys, as suggested by Konstantin. I decided I <br>
might first try to gain some understanding of why the issue cropped up <br>
since, if it will happen again in the future, a better understanding of <br>
what's gone wrong could be helpful. But I do need to admit that my <br>
understanding of authentication/encryption is quite limited, so perhaps I <br>
will be unable to retain much of whatever I might learn about the current <br>
issue.<br>
<br>
In response to Fabricio's suggestion of compiling a newer version of <br>
Dropbear, that is precluded by 2 factors: 1) I have no toolchain installed <br>
on the vps and, 2) that is by intention, since system resources are so <br>
paltry that compiling software there would be an iffy proposition. That <br>
said I suppose I could scour the interwebs for a static/standalone <br>
dropbear binary that uses uclibc or something, or perhaps compile my own <br>
on a better-endowed host.<br>
<br>
Further input will be appreciated.<br>
<br>
Thanks<br>
<br>
On Sat, 25 Jun 2022, Matt Johnston wrote:<br>
<br>
> -- Delivered via SpamCon Foundation DEA: <a href="http://dea.spamcon.org" rel="noreferrer" target="_blank">http://dea.spamcon.org</a><br>
> -- Replies will be sent to <a href="mailto:matt@ucc.asn.au" target="_blank">matt@ucc.asn.au</a><br>
> -- Additional Info: <a href="http://dea.spamcon.org/i/?v=134557338" rel="noreferrer" target="_blank">http://dea.spamcon.org/i/?v=134557338</a><br>
><br>
> On 2022-06-25 7:49 am, James Miller wrote:<br>
>> I set up a small low-resource VPS a few years ago to use mainly as a<br>
>> light-use xmpp server. I got Dropbear operating there so I could admin<br>
>> it. Dropbear seemed a good choice since system resources were so<br>
>> anemic. I recall it being quite challenging to get key-pair<br>
>> authentication to finally work there, though I can't recall many<br>
>> details about how I finally succeeded.<br>
><br>
> Most likely would be OpenSSH requiring sha2 for RSA signatures. If you can <br>
> use<br>
> ecdsa keys instead those should work OK.<br>
><br>
> Alternatively to keep using RSA, set<br>
><br>
>    Host old-host<br>
>        HostkeyAlgorithms +ssh-rsa<br>
>       PubkeyAcceptedAlgorithms +ssh-rsa<br>
><br>
> in your .ssh/config for the client which will allow the older sha1 RSA <br>
> signatures.<br>
> Which OpenSSH version is it? <a href="https://www.openssh.com/releasenotes.html" rel="noreferrer" target="_blank">https://www.openssh.com/releasenotes.html</a> has <br>
> details<br>
> of what has been deprecated.<br>
><br>
> Matt<br>
><br>
>> The VPS runs Ubuntu 16.04 (EMS), so the version of Dropbear there is a<br>
>> bit outdated (v2017.75). Since that release was made, various changes<br>
>> have happened to openssh that may, I assume, make it incompatible with<br>
>> this version of Dropbear. I am using ssh when I try to connect to the<br>
>> VPS, btw.<br>
><br>
</blockquote></div>