我已经使用autossh建立了一个连接,它在系统启动时创建了一些隧道,但是如果我尝试连接,在成功登录(使用RSA密钥)连接之后,下面是一个跟踪:
debug1: Authentication succeeded (publickey).
debug1: Remote connections from LOCALHOST:5006 forwarded to local address localhost:22
debug1: Remote connections from LOCALHOST:6006 forwarded to local address localhost:80
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: remote forward success for: listen 5006, connect localhost:22
debug1: remote forward success for: listen 6006, connect localhost:80
debug1: All remote forwarding requests processed
debug1: Sending environment.
debug1: Sending env LANG = it_IT.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2400, received 2312 bytes, in 1.3 seconds
Bytes per second: sent 1904.2, received 1834.4
debug1: Exit status 1有什么问题吗?
所有这些内容都由一个已经在另一台机器上运行的脚本管理(在同一台机器上创建反向隧道,但是使用不同的端口)。
发布于 2014-05-29 10:55:48
由于客户端发送的是一个环境,但没有命令,这意味着客户机试图以该用户身份启动一个shell。但该shell立即退出,导致ssh连接终止。
在不经过autossh的情况下,尝试从命令行中以用户的身份执行ssh。它可能会提供一些额外的提示,并且很有趣地知道,您是否可以通过这种方式获得一个shell。
用户可能配置了错误的shell,或者在~/.ssh/authorized_keys中使用command="…"覆盖了对shell的访问。
发布于 2014-05-29 10:36:02
尝试在/etc/ssh/ssh_config文件中添加KeepAlive选项(如果希望应用于单个用户,也可以添加~/.ssh/config )。
例如:
ClientAliveInterval 300
ClientAliveCountMax 2如果一个客户
Host *
ServerAliveInterval 300
ServerAliveCountMax 2如果服务器
https://serverfault.com/questions/599349
复制相似问题