YunoHost-Apps / borg_ynh

An experimental Borg implementation for YunoHost
https://www.borgbackup.org/
GNU Affero General Public License v3.0
19 stars 23 forks source link

Borg requesting user password #58

Closed KvL159 closed 3 years ago

KvL159 commented 3 years ago

I have followed the instructions and I get into several issues. I was able to fix most of them, but this one, I can't find a solution.

I have setup borg on server A and borgserver on server B, both on YNH 4.X BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -oStrictHostKeyChecking=yes " borg list servera@host.serverb:~/backup

I get a password prompt, which should not happen, since I'm using RSA keys.

I tried the same process with an empty test server A and the same server B, it seems the process worked flawlessly, I don't understand where is the issue. Note that I try the same command as above on this setup and I'm able to login in SSH without password.

Any ideas ?

KvL159 commented 3 years ago

Here is the debug for the SSH connection from server A (prod) to server B :

OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d 
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to domain [IP] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_borg_ed25519 type 3
debug1: identity file /root/.ssh/id_borg_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to domain:22 as 'USER'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:KEY
debug1: Host 'domain' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Will attempt key: /root/.ssh/id_borg_ed25519 ED25519 SHA256:KEY explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
Debian GNU/Linux 10
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_borg_ed25519 ED25519 SHA256:KEY explicit
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
KvL159 commented 3 years ago

After testing on another server with similar config, I'm able to reach SSH and login, but I get the following error:

PTY allocation request failed on channel 0
debug1: channel 0: free: client-session, nchannels 1
KvL159 commented 3 years ago

More information after checking on server /var/log/auth.log no matching key exchange method found. Their offer: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman

What is the algorythm used to generated the keys ?

JocelynDelalande commented 3 years ago

ed25519 : per https://github.com/YunoHost-Apps/borg_ynh/blob/b11c75dcf7d5a867d9720704dbfd0d8a9af404a4/scripts/install#L66

KvL159 commented 3 years ago

ed25519 : per

https://github.com/YunoHost-Apps/borg_ynh/blob/b11c75dcf7d5a867d9720704dbfd0d8a9af404a4/scripts/install#L66

OK thanks, it seems both servers have this algorythm

zamentur commented 3 years ago

I don't know why

I get a password prompt, which should not happen, since I'm using RSA keys.

ARe you sure it's not the passphrase request for openning the borg repo ?