我已经通过autossh建立了一条隧道。
这样做是可行的:
autossh -M 33201 -N -i myIdFile -R 33101:localhost:22 autossh@myhost.com我想在后台运行autossh。使用-f选项似乎很容易。
但是,这是行不通的:
autossh -f -M 33201 -N -i myIdFile -R 33101:localhost:22 autossh@myhost.comAutossh在后台运行良好,但ssh连接似乎每次都失败。在/var/syslog中,我看到多次出现以下情况:
autossh[3420]: ssh exited with error status 255; restarting ssh我做错了什么?一个疯狂的猜测是,它与通过密钥文件进行身份验证有关。如何调试这个选项(将-v添加到ssh选项似乎不会在任何地方进行日志记录)。
编辑:我使用-y选项获得了一些ssh日志
/usr/bin/ssh[3484]: debug1: Next authentication method: publickey
/usr/bin/ssh[3484]: debug1: Trying private key: /home/myuser/.ssh/id_rsa
/usr/bin/ssh[3484]: debug1: Trying private key: /home/myuser/.ssh/id_dsa
/usr/bin/ssh[3484]: debug1: Trying private key: /home/myuser/.ssh/id_ecdsa
/usr/bin/ssh[3484]: debug1: No more authentication methods to try.
/usr/bin/ssh[3484]: fatal: Permission denied (publickey).
autossh[3469]: ssh exited with error status 255; restarting ssh因此,在使用-i myIdFile选项时,autossh似乎不接受我的标识文件( -f )。为什么会这样呢?
(autossh 1.4c在拉斯宾)
发布于 2013-08-27 21:50:23
不确定-f是怎么回事,但您也可以查看它:
nohup autossh -M 33201 -N -f -i myIdFile -R 33101:localhost:22 autossh@myhost.com &发布于 2023-03-08 18:32:32
我有一个问题,主机的关键指纹被重置,并导致一个255错误。
通过将机器添加回已知的主机,试图建立正常的SSH会话修复了autossh的问题:
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[XXXXXXXXXXXXX]:22' (ED25519) to the list of known hosts.systemctl status autossh.service在上述步骤之后立即工作(同时也跨重新启动)。
https://serverfault.com/questions/534229
复制相似问题