大网数据广告活动
服务器运维问答

Borg backup remotely gives error

· 52CE 我爱测

Trying to use borg to backup Machine 1 to a remote Machine 2(which is synology), gives the error Remote: sh: borg: command not found Connection closed by remote host. Is borg working on the server? All permissions and firewall ha…

问题原文

原帖链接 · Vasiliki · CC BY-SA 4.0

Trying to use borg to backup Machine 1 to a remote Machine 2(which is synology), gives the error

Remote: sh: borg: command not found
Connection closed by remote host. Is borg working on the server?

All permissions and firewall have been tested. Machine1 can ssh to Machine2 but when trying to do borg init --encryption=repokey borgdemo@Machine2:./demo from Machine1, it is giving the above error. Trying to use borg on Machine2 works fine. Any ideas?

社区高分解答

原帖链接 · Cyril Chaboisseau · CC BY-SA 4.0

Sometimes, you cannot create such a symlink on the remote server (not enough rights on machine 2)

so, the quickest way to deal with different paths is to use the --remote-path argument on the client side:

/usr/bin/borg init --remote-path /usr/local/bin/borg borgdemo@Machine2:./demo

...but the best solution is to force an absolute path on the server side on the ssh config

$ cat .ssh/authorized_keys
command="/usr/local/bin/borg serve" ssh-ed25519 AAAAC...xyz

with this setting, every borg connection from the client through the ssh tunnel will be handled on the server side calling the right binary

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。