装的ubuntu 16.04
openssh-server也都装了,只是端口改成了23,然后连接不上,报如下错误,请问有遇到这个情况的嘛
Connecting to 192.168.10.12:23...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.10.12) at 14:53:13.
Type `help' to learn how to use Xshell prompt.
什么情况下能连上?
端口改成23之前能连上吗?
服务器端ssh端口改成23了吗?
服务器端ssh服务启动了吗? (
service ssh status
)服务器端23端口开启了吗? (
ss -tlnp
)服务器端有没有设置防火墙阻止23端口的访问?(
iptables -nL
)通过
To escape to local shell, press 'Ctrl+Alt+]'.
得知你服务端 23 端口对应的服务是telnet,并不是ssh。解决办法:
/etc/init.d/openbsd-inetd stop
现在很少用这个服务传输数据了,因为是明文传输,不安全),把ssh服务端口修改为23 (修改配置文件在/etc/ssh/sshd_config
),然后重启ssh服务(service ssh restart
)