无法通过端口 443 连接到 ssh
我正在使用 Linux,并在我的 ubuntu 机器上设置了 ssh。当我将默认侦听端口设置为 22 时,我能够在 Windows 7 机器上使用 PUTTY 连接。但是,一旦我将监听端口从 22 更改为 443,我就无法从 Windows 计算机进行连接。
在 /etc/ssh/sshd_config 中,
#Port 22
Port 443
我运行了 Apache2,并认为这可能是问题所在。 /etc/apache2/sites-available/ 文件夹中有一个 default-ssl 文件。然而,我停止了 Apache 并尝试在 Windows 中连接,但没有成功。
我继续将端口更改为 52101,该端口号有效。
我认为还有其他东西正在监听 443。
当执行 netstat -lnptu 时,我得到
Proto Recv-Q Send-Q 本地地址 外部地址 状态 PID/程序名称 tcp 0 0 0.0.0.0:443 0.0.0.0:* 听 - tcp6 0 0 :::443 :::* LISTEN -
我在将 ssh 监听端口更改为 22 后执行了 netstat。
有人知道为什么这不起作用吗?
I am playing with Linux and have setup ssh on my ubuntu box. When I had the default listening port set to 22, I was able to connect with PUTTY on my Windows 7 box. However, once I changed the listening port from 22 to 443, I am unable to connect from my windows machine.
In /etc/ssh/sshd_config
#Port 22
Port 443
I had Apache2 running and thought that could have been the issue. There was a default-ssl file in the /etc/apache2/sites-available/ folder. However, I stopped Apache and attempted to connect in Windows with no luck.
I went ahead and changed the Port to 52101 and that port number works.
I'm thinking that there is something else listening on 443.
When doing netstat -lnptu I get
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
I did the netstat after I had changed ssh listening port to 22.
Does anyone have any thoughts as to why this is not working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,如果您有默认的日志记录设置(检查 sshd_config 中的日志记录下设置的内容),您应该能够在 /var/log/auth.conf 中找到来自 sshd 的任何错误消息。这将从 sshd 的角度告诉您出了什么问题。最有可能的是其他一些进程正在侦听该端口(从您的 netstat 来看似乎是这种情况)。尝试
看看是什么进程正在执行此操作。
Well, if you have the default setting for logging (check what is set under logging in sshd_config), you should be able to find any error messages from sshd in /var/log/auth. That will tell you what is going wrong from sshd's perspective. The most likely is that some other process is listening on the port (which seems to be the case from your netstat). Try
to see what process is doing that.
安装 Firestarter(GUI 防火墙)并查看是否有东西阻塞该端口。
作为远程控制的提示,我使用 Teamviewer。如果您还没有检查过,那么它非常有用,至少对我而言。
Install Firestarter (GUI Firewall) and see if something is blocking that port.
As a tip to remote control, I use Teamviewer. If you haven't checked that out, it's very useful, atleast to me.