Vorta: If .ssh/config present backups don't start

Created on 29 Nov 2020  路  7Comments  路  Source: borgbase/vorta

Describe the bug
The Vorta Backup does not work if there is a config file with settings in .ssh/

To Reproduce
Steps to reproduce the behavior:

  1. Go to Vorta
  2. Click on Backup now
  3. See error : ERROR: Connection closed by remote host. Is borg working on server ?

Then to workaround it do:

  1. Move or remove your config eg. mv .ssh/config .ssh/myconfig-backup
  2. Go to Vorta
  3. Click on Backup now
  4. Backups now working

Desktop (please complete the following information):

  • OS: Ubuntu 20.10
  • Vorta version: v0.7.1
  • Borg version: 1.1.13
  • Installed from: Ubuntu Software (flatpak-system)

Additional context
When the error occurs, logs are displaying :

vorta.borg.borg_thread - INFO - Running command /app/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4  /home/user/yolo
vorta.borg.borg_thread - WARNING - Remote: Bad owner or permissions on /home/user/.ssh/config
vorta.borg.borg_thread - ERROR - Connection closed by remote host. Is borg working on the server?

When I apply the workaround, logs are displaying:

vorta.borg.borg_thread - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
asyncio - DEBUG - Using selector: EpollSelector
root - DEBUG - Found 1 passwords matching repo URL.
vorta.borg.borg_thread - INFO - Running command /app/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 [....] /home/user/yolo
vorta.borg.borg_thread - INFO - Creating archive at "[....]"
vorta.borg.borg_thread - INFO - Remote: Storage quota [....]

I'm not sure, but it seems related to https://github.com/borgbase/vorta/issues/526

low enhancement

Most helpful comment

So the issue to solve here is displaying the ssh error messages, instead of overwriting them.
Example json output:

{"type": "log_message", "time": 1607677712.879403, "message": "Remote: Warning: Identity file /home/user/.ssh/keyname not accessible: No such file or directory.", "levelname": "WARNING", "name": "root"}
{"type": "log_message", "time": 1607677712.8797798, "message": "Remote: Bad owner or permissions on /home/user/.ssh/config", "levelname": "WARNING", "name": "root"}
{"type": "log_message", "time": 1607677712.883788, "message": "Connection closed by remote host. Is borg working on the server?", "levelname": "ERROR", "name": "borg.archiver", "msgid": "ConnectionClosedWithHint"}

All 7 comments

I have an ssh config and it works fine..

The error message seems to be permission related. Check your ssh config permissions.

Same here. Had my ~/.ssh/config forever and never an issue with Borg. Maybe the issue is due to a specific setting in your config?

This is for all users out there that may or may not encounter the same problem.

What I did to test and finally fix my problem :

  • Remove (or rename ) any file named config from .ssh
  • Launch Vorta, click "Backup Now" and backups work as expected.

Now let's "brake" it:

  • Create an empty config file inside .ssh/ with your regular user eg. touch .ssh/config
  • Launch Vorta, click "Backup Now" and you get the message "ERROR: Connection closed by remote host. Is borg working on server?".
  • Check log files where you get : WARNING - Remote: Bad owner or permissions on /home/user/.ssh/config
  • Check permissions of the empty config file : -rw-rw-r-- 1 user user config

Now let's "fix" it:

  • Even though the user had the permission to read and edit the file, this is not sufficient. I had to remove the permissions from others. In other words, I needed to have rw for user only permissions on config.
  • To fix permissions run chmod 600 .ssh/config
  • Launch Vorta, click "Backup Now" and backups work as expected.

Should the message ""ERROR: Connection closed by remote host. Is borg working on server" also include the warning WARNING - Remote: Bad owner or permissions on /home/user/.ssh/config ?

Should the message ""ERROR: Connection closed by remote host. Is borg working on server" also include the warning WARNING - Remote: Bad owner or permissions on /home/user/.ssh/config

Yes, I think that would be for the best

So the issue to solve here is displaying the ssh error messages, instead of overwriting them.
Example json output:

{"type": "log_message", "time": 1607677712.879403, "message": "Remote: Warning: Identity file /home/user/.ssh/keyname not accessible: No such file or directory.", "levelname": "WARNING", "name": "root"}
{"type": "log_message", "time": 1607677712.8797798, "message": "Remote: Bad owner or permissions on /home/user/.ssh/config", "levelname": "WARNING", "name": "root"}
{"type": "log_message", "time": 1607677712.883788, "message": "Connection closed by remote host. Is borg working on the server?", "levelname": "ERROR", "name": "borg.archiver", "msgid": "ConnectionClosedWithHint"}

Thanks @cerebrux the workaround _eventually_ worked.

I think this should have a higher priority especially since the error message is not clear.
I do use the ssh config file:

Host ssh.dev.azure.com
  User git
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/work_azure_rsa
  IdentitiesOnly yes

Host *
  User git
  IdentityFile ~/.ssh/id_rsa
  IdentitiesOnly yes
  AddKeysToAgent yes
  UseKeychain yes

Was this page helpful?
0 / 5 - 0 ratings