Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIT can't unlock my ssh key anymore #1551

Closed
KOMA-Elektronik opened this issue Oct 15, 2023 · 4 comments
Closed

BIT can't unlock my ssh key anymore #1551

KOMA-Elektronik opened this issue Oct 15, 2023 · 4 comments
Labels
Keyrings uses a keyring like kdewallet, SecretService, GnomeKeyring

Comments

@KOMA-Elektronik
Copy link

I've been using BIT for years with an ssh setup. I run BIT locally as root and ssh into my server that I use for storing the backups. I recently upgraded the machine from which I am starting BIT from Ubuntu 20.04 to 22.04. Can't tell if this has something to do with this issue though because since the upgrade I have been successfully making backups until yesterday. So maybe this is not the causing issue.

It seems like BIT (or cron?) can't unlock my ssh key anymore. I can say with 100% certainty that the ssh key is working and can be unlocked with the provided password. If I do a "ssh backupuser@backupserver" (dummy names) I can unlock the root ssh key with the given password and ssh into the backup server.

This is the output of starting backintime-qt from cli, it seems like there is some importing issue:

 ⚡ root@thinkstation  ~  backintime-qt --debug
DEBUG: [common/backintime.py:583 argParse] Arguments: {'debug': True} | unknownArgs: []

Back In Time
Version: 1.2.1

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

DEBUG: [common/backintime.py:670 getConfig] config file: /root/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /root/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Hauptprofil
DEBUG: [common/pluginmanager.py:90 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin usercallbackplugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin qt4plugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [plugins/usercallbackplugin.py:46 UserCallbackPlugin.callback] Call user-callback: /root/.config/backintime/user-callback 1 Hauptprofil 5
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
DEBUG: [common/tools.py:812 keyringSupported] No keyring due to import error.
DEBUG: [plugins/usercallbackplugin.py:46 UserCallbackPlugin.callback] Call user-callback: /root/.config/backintime/user-callback 1 Hauptprofil 7
DEBUG: [common/sshtools.py:226 SSH.startSshAgent] ssh-agent started successful: SSH_AUTH_SOCK=/tmp/ssh-XXXXXXlw3de8/agent.49463 | SSH_AGENT_PID=49464
DEBUG: [common/sshtools.py:269 SSH.unlockSshAgent] Add private key /root/.ssh/id_ecdsa to ssh agent
DEBUG: [common/sshtools.py:274 SSH.unlockSshAgent] Password available: True
ERROR: [common/sshtools.py:304 SSH.unlockSshAgent] Failed to unlock SSH private key /root/.ssh/id_ecdsa: 
DEBUG: [common/sshtools.py:316 SSH.unlockSshAgent] Was not able to unlock private key /root/.ssh/id_ecdsa
ERROR: [common/config.py:1368 Config.canBackup] /root/.local/share/backintime/mnt/1_49454/backintime/thinkstation/root/1 does not exist
DEBUG: [common/tools.py:1244 readCrontab] Read 2 lines from users crontab
DEBUG: [common/config.py:1477 Config.removeOldCrontab] Clearing system Back In Time entries
DEBUG: [common/config.py:1511 Config.cronLine] Profile: Hauptprofil | Automatic backup: Wiederholend (anacron)
DEBUG: [common/config.py:1461 setupCron] Crontab didn't change. Skip writing.
DEBUG: [common/tools.py:812 keyringSupported] No keyring due to import error.
DEBUG: [common/tools.py:812 keyringSupported] No keyring due to import error.
DEBUG: [common/tools.py:812 keyringSupported] No keyring due to import error.
WARNING: [common/config.py:1158 rsyncOptions] Found rsync flag "--old-args". That flag will be removed from the options because it does conflict with the flag "-s" (also known as "--secluded-args" or "--protected-args") which is used by Back In Time to force the "new form of argument protection" in rsync.

backintime --diagnostics doesn't seem to work on my machine, I get told --diagnostics is an unknown argument.

I have backintime installed from package sources:

 ✘ ⚡ root@thinkstation  ~  apt search backintime   
Sortierung… Fertig
Volltextsuche… Fertig
backintime-common/jammy-updates,jammy-updates,jammy-security,jammy-security,now 1.2.1-3ubuntu0.3 all  [Installiert,automatisch]
  Einfaches System für Schnappschüsse/Sicherheitskopien (gemeinsame Dateien)

backintime-qt/jammy-updates,jammy-updates,jammy-security,jammy-security,now 1.2.1-3ubuntu0.3 all  [installiert]
  Einfaches System für Schnappschüsse/Sicherheitskopien (grafische Oberfläche)

backintime-qt4/jammy-updates,jammy-updates,jammy-security,jammy-security 1.2.1-3ubuntu0.3 all
  System für Schnappschüsse/Sicherheitskopien (Qt-4-Front-End, Übergangspaket)

Would be great if someone could help me figure this out. Please let me know if I need to provide any more info.

@aryoda
Copy link
Contributor

aryoda commented Oct 15, 2023

You are using a quite old (but well-known working) BiT version (v1.2.1) which does not yet support the new --diagnostics argument.

Your problems are most probably caused by a semantical change in the Python keyring package which is now using "keyring chaining algorithm" by default. Could you please either

a) try to apply this work-around described in our README:
https://github.com/bit-team/backintime#non-working-password-safe-and-bit-forgets-passwords-keyring-backend-issues

b) or manually install our latest release where the problem has been fixed in BiT to support the new ChainerBackend of keyring (see #1410)

Edit: It would be great to try a) first to minimize other "side effects" when trying to find the exact reason for this problem. I am also just unsure of the impact of running BiT as root while using the keyring to store the ssh password in BiT v1.2.1. It would be great to show us your (anonymized) configuration here in case a) does not work.

@KOMA-Elektronik
Copy link
Author

Thanks for the lightning-fast answer. I went ahead to add the stable repo and install the latest version. I wasn't aware of the fact that my BIT version was so old (seems like 4 years old). The issue went away immediately.

So, could be that my upgrade to the next LTS version changed some python packages I guess. If you want me to provide any further infos or try something out, I'm happy to contribute. Would be even happy to downgrade again and collaborate if needed. Otherwise I would mark this as solved. Thanks!

@aryoda aryoda added the Keyrings uses a keyring like kdewallet, SecretService, GnomeKeyring label Oct 15, 2023
@aryoda
Copy link
Contributor

aryoda commented Oct 15, 2023

I went ahead to add the stable repo and install the latest version.

Just for documentation purposes here: Which "stable repo" did you use and which BiT version are you using now?

The issue went away immediately.

Happy to hear that :-) So you can close the issue if you are absolutely sure (or re-open it again later)

@KOMA-Elektronik
Copy link
Author

Oh, sorry for not clarifying. I added ppa:bit-team/stable and now using Back In Time Version: 1.3.3-3. Seems like it's actually not the latest latest version but at least not 4 years old. Thanks again for this great piece of free and open source software and for keeping people like me from typing out multi-line rsync commands :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Keyrings uses a keyring like kdewallet, SecretService, GnomeKeyring
Projects
None yet
Development

No branches or pull requests

2 participants