如何修复 bup bup.client.ClientError: server tunnel returned exit code 255
问题:
使用 bup 远程功能运行 bup 时,例如使用
bup_init_remote.sh
bup init -r 192.168.1.215:/var/bup你看到这些错误消息:
bup_client_traceback.txt
Traceback (most recent call last):
File "/usr/lib/bup/cmd/bup-init", line 45, in <module>
cli = client.Client(argv_bytes(opt.remote), create=True)
File "/usr/lib/bup/cmd/../bup/client.py", line 108, in __init__
self._available_commands = self._get_available_commands()
File "/usr/lib/bup/cmd/../bup/client.py", line 181, in _get_available_commands
raise ClientError('unexpected help header ' + repr(line))
bup.client.ClientError: unexpected help header b''
Exception ignored in: <function Client.__del__ at 0x7fa7d7e2bb80>
Traceback (most recent call last):
File "/usr/lib/bup/cmd/../bup/client.py", line 122, in __del__
self.close()
File "/usr/lib/bup/cmd/../bup/client.py", line 147, in close
raise ClientError('server tunnel returned exit code %d' % rv)
bup.client.ClientError: server tunnel returned exit code 255解决方案
你需要接受远程主机密钥并设置无密码登录,否则 bup 将无法使用 SSH 连接到主机。
只需 SSH 到主机不带用户名(因为 bup 也不会使用显式用户名):
ssh_accept_host.sh
ssh 192.168.1.215如果你看到类似这样的提示
ssh_host_auth_prompt.txt
The authenticity of host '10.11.12.15 (10.11.12.15)' can't be established.
ECDSA key fingerprint is SHA256:ZaIJ51uHwI9Q3i/CKdjF3Erwt27CjQqa4YL45UV5rwM.
Are you sure you want to continue connecting (yes/no/[fingerprint])?输入 yes 并按回车。
如果你看到密码提示,你尚未正确设置 SSH。
我在 bup 客户端上使用以下 ~/.ssh/config:
ssh_config_bup.txt
Host 192.168.1.215
User bup
IdentityFile /home/uli/.ssh/id_bup
IdentitiesOnly yes并且我已将 /home/uli/.ssh/id_bup.pub 的内容复制粘贴到 bup 服务器上的 /home/bup/.ssh/authorized_keys 以设置无密码登录。
Check out similar posts by category:
Networking
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow