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

BORG_RSH does not work #260

Open
dave12311 opened this issue Sep 3, 2023 · 4 comments
Open

BORG_RSH does not work #260

dave12311 opened this issue Sep 3, 2023 · 4 comments

Comments

@dave12311
Copy link

Command specified by BORG_RSH does not seem to get passed to ssh.

E.g. trying to specify a key with a non-default name BORG_RSH="ssh -i /root/.ssh/borgbase" results in

SSH command line: ['ssh', '<REDACTED>.repo.borgbase.com', 'borg', 'serve', '--debug']
Remote: <REDACTED>.repo.borgbase.com: Permission denied (publickey).
Connection closed by remote host. Is borg working on the server?
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/borg/archiver.py", line 5324, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver.py", line 5255, in run
    return set_ec(func(args))
                  ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver.py", line 161, in wrapper
    repository = RemoteRepository(location.omit_archive(), create=create, exclusive=argument(args, exclusive),
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/remote.py", line 578, in __init__
    raise ConnectionClosedWithHint('Is borg working on the server?') from None
borg.remote.ConnectionClosedWithHint: Connection closed by remote host. Is borg working on the server?

Platform: Linux 198e743aacb9 5.10.160-rk35xx #1 SMP Thu Jul 6 13:36:29 UTC 2023 aarch64
Linux: Unknown Linux  
Borg: 1.2.6  Python: CPython 3.11.5 msgpack: 1.0.5 fuse: llfuse 1.5.0 [pyfuse3,llfuse]
PID: 15  CWD: /
sys.argv: ['/usr/local/bin/borg', 'init', '--encryption', 'repokey-blake2', '--debug', 'ssh://<REDACTED>.repo.borgbase.com/./repo']
SSH_ORIGINAL_COMMAND: None

Renaming the key to the default id_rsa works.

@witten
Copy link
Collaborator

witten commented Sep 3, 2023

You may already be aware, but you can set the ssh_command option in borgmatic's configuration instead of the BORG_SSH environment variable.

@modem7
Copy link
Member

modem7 commented Apr 1, 2024

@dave12311 - did @witten's comment assist? Are you still having this issue?

@dave12311
Copy link
Author

I ended up just passing the key with the default name using VOLUME_SSH, but I guess the documentation should still be updated to reflect this. Thanks for the help though!

@modem7
Copy link
Member

modem7 commented Apr 1, 2024

I ended up just passing the key with the default name using VOLUME_SSH, but I guess the documentation should still be updated to reflect this. Thanks for the help though!

Happy to review a PR for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants