我需要从 Windows 10 计算机连接到我的 Ubuntu 计算机 (15.04)。我在 Ubuntu 上安装了 nomachine 服务器,我可以看到它根据服务器 GUI 在端口 4000 上运行 NX 协议
从 Windows 机器上,当我尝试连接时,出现错误 138 连接超时。
测试:
我可以使用 Putty 从 Windows 10 顺利通过 SSH 连接到 Ubuntu 计算机。但我似乎无法让 nomachine 正常工作。
任何建议都将不胜感激。
编辑1
我运行以下命令来查看端口 4000 是否打开:
netstat -ntlp | grep LISTEN
除此之外,我得到的答复如下:
tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN -
编辑2
我删除并重新安装如下:
me@devbox:~$ sudo dpkg --purge nomachine && sudo rm -rf /usr/NX /etc/NX .nx
[sudo] password for me:
(Reading database ... 496028 files and directories currently installed.)
Removing nomachine (5.1.26-1) ...
NX> 702 Starting uninstall at: Tue Jul 19 09:32:57 2016.
NX> 702 Uninstalling: nxserver version: 5.1.26.
NX> 702 Uninstall log is: /usr/NX/var/log/nxuninstall.log.
NX> 702 Saving configuration file to: /usr/NX/etc/server.cfg.backup.
NX> 702 Saving passwords DB to: /usr/NX/etc/passwords.db.backup.
NX> 702 Saving users DB to: /usr/NX/etc/users.db.backup.
NX> 702 Saving administrators DB to: /usr/NX/etc/administrators.db.backup.
NX> 702 Saving profiles DB to: /usr/NX/etc/profiles.db.backup.
NX> 702 Saving guests DB to: /usr/NX/etc/guests.db.backup.
NX> 702 Saving hosts DB to: /usr/NX/etc/hosts.db.backup.
NX> 702 Saving nodes DB to: /usr/NX/etc/nodes.db.backup.
NX> 702 Saving groups DB to: /usr/NX/etc/groups.db.backup.
NX> 702 Uninstalling: nxnode version: 5.1.26.
NX> 702 Uninstall log is: /usr/NX/var/log/nxuninstall.log.
NX> 702 Saving configuration file to: /usr/NX/etc/node.cfg.backup.
NX> 702 Deleting user: nx from the system.
NX> 702 Uninstalling: nxplayer version: 5.1.26.
NX> 702 Uninstall log is: /usr/NX/var/log/nxuninstall.log.
NX> 702 Uninstalling: nxclient version: 5.1.26.
NX> 702 Uninstall log is: /usr/NX/var/log/nxuninstall.log.
NX> 702 Uninstall completed at: Tue Jul 19 09:33:52 2016.
Purging configuration files for nomachine (5.1.26-1) ...
me@devbox:~$ sudo dpkg -i /home/me/Downloads/nomachine_5.1.26_1_amd64.deb
Selecting previously unselected package nomachine.
(Reading database ... 496015 files and directories currently installed.)
Preparing to unpack .../nomachine_5.1.26_1_amd64.deb ...
Unpacking nomachine (5.1.26-1) ...
Setting up nomachine (5.1.26-1) ...
NX> 700 Starting install at: Tue Jul 19 09:42:52 2016.
NX> 700 Installing: nxclient version: 5.1.26.
NX> 700 Using installation profile: Ubuntu.
NX> 700 Install log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Compiling the USB module.
NX> 700 Installing: nxplayer version: 5.1.26.
NX> 700 Using installation profile: Ubuntu.
NX> 700 Install log is: /usr/NX/var/log/nxinstall.log.
NX> 700 To connect the remote printer to the local desktop,
NX> 700 the user account must be a member of the CUPS System Group: lpadmin.
NX> 700 Installing: nxnode version: 5.1.26.
NX> 700 Using installation profile: Ubuntu.
NX> 700 Install log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Creating configuration in: /usr/NX/etc/node.cfg.
NX> 700 Installing: nxserver version: 5.1.26.
NX> 700 Using installation profile: Ubuntu.
NX> 700 Install log is: /usr/NX/var/log/nxinstall.log.
NX> 700 Creating configuration in: /usr/NX/etc/server.cfg.
NX> 700 Install completed at: Tue Jul 19 09:43:33 2016.
NX> 700 NoMachine was configured to run the following services:
NX> 700 NX service on port: 4000
me@devbox:~$
然后我启动了该服务的 GUI 并确保它正在运行。
现在,在我的 Windows 机器上,我重试连接,但仍然失败。
当您说可能是防火墙时,我应该在 Ubuntu 端还是 Windows 端检查?
答案1
也许你更改了 nxserver 配置。尝试从系统中完全删除 NoMachinesudo dpkg --purge nomachine && sudo rm -rf /usr/NX /etc/NX .nx
并从头开始重新安装。
可能是防火墙的问题。但奇怪的是,我在 Ubuntu 上经常使用 NoMachine,却没有遇到这样的问题。查看他们的论坛可能是个好主意。
答案2
这可能是服务器上的防火墙,请检查端口是否被阻止。
您可以尝试将其关闭,尝试连接,然后在测试后将其重新打开。
答案3
对我来说,这看起来像是防火墙问题,你可以尝试在 iptables 中启用端口 4000
/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 4000 -j ACCEPT
启用 UDP 端口也很好。