Borg backup over ssh - correct syntax - Stack Overflow

Note: My setup is a server hosted by Hetzner and a storage box hosted by Hetzner.This link says:Remote

Note: My setup is a server hosted by Hetzner and a storage box hosted by Hetzner.

This link says:

Remote repositories accessed via ssh user@host:

  • user@host:/path/to/repo - remote repo, absolute path
  • ssh://user@host:port/path/to/repo - same, alternative syntax, port can be given

When I try the first syntax, notice, without ssh://, it fails:

# b init --encryption=keyfile [email protected]:23/home/testing                     
[email protected]'s password: 
Remote: exec request failed on channel 0
Connection closed by remote host. Is b working on the server?

However, the alternative syntax works fine:

# b init --encryption=keyfile ssh://[email protected]:23/home/testing-on-12-march-2025

Why is this? The two are equivalent.Do I misunderstand?

Edit: This worked:

# BORG_RSH="ssh -p23" b init --encryption=keyfile [email protected]:/home/testing-on-14-march-2025

Note: My setup is a server hosted by Hetzner and a storage box hosted by Hetzner.

This link says:

Remote repositories accessed via ssh user@host:

  • user@host:/path/to/repo - remote repo, absolute path
  • ssh://user@host:port/path/to/repo - same, alternative syntax, port can be given

When I try the first syntax, notice, without ssh://, it fails:

# b init --encryption=keyfile [email protected]:23/home/testing                     
[email protected]'s password: 
Remote: exec request failed on channel 0
Connection closed by remote host. Is b working on the server?

However, the alternative syntax works fine:

# b init --encryption=keyfile ssh://[email protected]:23/home/testing-on-12-march-2025

Why is this? The two are equivalent.Do I misunderstand?

Edit: This worked:

# BORG_RSH="ssh -p23" b init --encryption=keyfile [email protected]:/home/testing-on-14-march-2025

Share Improve this question edited Mar 14 at 11:06 user2338823 asked Mar 12 at 15:14 user2338823user2338823 5551 gold badge4 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

They aren't quite as equivalent as they first appear.

In the version with ssh://, the colon (:) in host:23 separates the hostname from the port; the SSH client in B uses the specified port (23). In the version without ssh://, the colon separates the hostname from the first part of the file path; the SSH client in B uses the standard SSH port (22). From the error you posted, your host isn't listening on port 22, so the connection is never established.

Most SSH clients have a -p or --port CLI flag where you could define a specific nonstandard port, but it doesn't look like B has that. Instead, you'll need to use the ssh:// format every time if you want to use any port other than 22 for B. (This is a common question on the git tag, btw; all the major repo hosts offer an alternate hostname listening on port 443 for SSH traffic in case a network or ISP filters port 22.)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744745538a4591271.html

相关推荐

  • Borg backup over ssh - correct syntax - Stack Overflow

    Note: My setup is a server hosted by Hetzner and a storage box hosted by Hetzner.This link says:Remote

    8小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信