admin管理员组文章数量:1391977
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
1 Answer
Reset to default 1They 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.)
本文标签: Borg backup over sshcorrect syntaxStack Overflow
版权声明:本文标题:Borg backup over ssh - correct syntax - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744745537a2622853.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论