我希望能够从笔记本电脑和其他设备远程连接到 LAN 内的日常驱动程序 (Debian 11)。 ssh 工作正常,但 Chrome 和 Firefox 都不愿意通过 ssh 运行/某些任务在 GUI 环境中更容易完成。笔记本电脑运行 MS-Windows 10,我通常使用 Mobaxterm 进行连接。
具体来说,我希望计算机继续作为运行 X 并具有图形登录功能的工作站运行,同时还通过网络提供多用户 GUI 会话。因此,我的选择似乎是:XDMCP、VNC 或 RDP。我过去曾成功配置过所有 3 个项目 - 但最近没有成功。我原以为这会很简单。
作为运行以下命令的先决条件,我以 sddm 的速度安装了 lightdm,并确保没有 iptables 规则。通过控制台登录仍然有效,但我无法使 XDMCP 或 VNC 工作。我没有尝试过 RDP,因为我之前的经验是它不如其他机制强大。
- 尝试 XDMCP:修改 /etc/lightdm.conf ,添加: [XDMCPServer]enabled=true
重新启动。netstat -nap
显示 lightdm 监听 UDP 0.0.0.0:177。当我尝试从运行 Mobaxterm 的 MS-Windows 计算机进行连接时,一个窗口立即打开并关闭。 lightdm.log 显示:
[+344.80s] DEBUG: Got Query(authentication_names=[]) from 192.168.0.87:57445
[+344.80s] DEBUG: Send Willing(authentication_name='' hostname='animal' status='') to 192.168.0.87:57445
[+345.04s] DEBUG: Got Request(display_number=1 connections=[] authentication_name='' authentication_data= authorization_names=['MIT-MAGIC-COOKIE-1' 'XDM-AUTHORIZATION-1'] manufacturer_display_id='') from 192.168.0.87:57445
[+345.04s] DEBUG: Send Decline(status='No valid address found' authentication_name='' authentication_data=) to 192.168.0.87:57445
当我在最后一个日志条目中搜索错误消息时,Google 发现了 6 个命中 - 它们没有帮助我。
- 正在尝试VNC。我撤销了上述更改,并补充道:
[VNCServer]
enabled=true
command=Xvnc
port=5900
listen-address=0.0.0.0
width=1024
height=768
depth=8
重新启动。 netstat -nap 再次显示 lightdm 正在监听 TCP 0.0.0.0:5900。在尝试使用 Mobaterm 连接时,客户端提示我输入密码,我将其留空并得到“连接已关闭”。这又重复了第二次。日志条目如下所示。
[+50.20s] DEBUG: Got VNC connection from 192.168.0.87:52259
[+50.20s] DEBUG: Seat vnc0: Loading properties from config section Seat:*
[+50.20s] DEBUG: Seat vnc0: Starting
[+50.20s] DEBUG: Seat vnc0: Creating greeter session
[+50.20s] DEBUG: Seat vnc0: Creating display server of type x
[+50.20s] DEBUG: XServer 1: Logging to /var/log/lightdm/x-1.log
[+50.20s] DEBUG: XServer 1: Writing X server authority to /var/run/lightdm/root/:1
[+50.20s] DEBUG: XServer 1: Launching X Server
[+50.20s] DEBUG: Launching process 1430: /usr/bin/Xvnc -rfbauth /etc/vncpasswd :1 -auth /var/run/lightdm/root/:1 -nolisten tcp -inetd -geometry 1024x768 -depth 8
[+50.20s] DEBUG: XServer 1: Waiting for ready signal from X server :1
[+50.20s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat1
[+50.23s] DEBUG: Process 1430 exited with return value 1
[+50.23s] DEBUG: XServer 1: X server stopped
[+50.23s] DEBUG: XServer 1: Removing X server authority /var/run/lightdm/root/:1
[+50.23s] DEBUG: Seat vnc0: Display server stopped
[+50.23s] DEBUG: Seat vnc0: Stopping session
[+50.23s] DEBUG: Seat vnc0: Session stopped
[+50.23s] DEBUG: Seat vnc0: Stopping display server, no sessions require it
[+50.23s] DEBUG: Seat vnc0: Stopping; greeter display server failed to start
[+50.23s] DEBUG: Seat vnc0: Stopping
[+50.23s] DEBUG: Seat vnc0: Stopped
[+57.93s] DEBUG: Got VNC connection from 192.168.0.87:52260
[+57.93s] DEBUG: Seat vnc1: Loading properties from config section Seat:*
[+57.93s] DEBUG: Seat vnc1: Starting
[+57.93s] DEBUG: Seat vnc1: Creating greeter session
[+57.93s] DEBUG: Seat vnc1: Creating display server of type x
[+57.93s] DEBUG: XServer 1: Logging to /var/log/lightdm/x-1.log
[+57.93s] DEBUG: XServer 1: Writing X server authority to /var/run/lightdm/root/:1
[+57.93s] DEBUG: XServer 1: Launching X Server
[+57.93s] DEBUG: Launching process 1431: /usr/bin/Xvnc -rfbauth /etc/vncpasswd :1 -auth /var/run/lightdm/root/:1 -nolisten tcp -inetd -geometry 1024x768 -depth 8
[+57.93s] DEBUG: XServer 1: Waiting for ready signal from X server :1
[+57.93s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat2
[+57.94s] DEBUG: Process 1431 exited with return value 1
[+57.94s] DEBUG: XServer 1: X server stopped
[+57.94s] DEBUG: XServer 1: Removing X server authority /var/run/lightdm/root/:1
[+57.94s] DEBUG: Seat vnc1: Display server stopped
[+57.94s] DEBUG: Seat vnc1: Stopping session
[+57.94s] DEBUG: Seat vnc1: Session stopped
[+57.94s] DEBUG: Seat vnc1: Stopping display server, no sessions require it
[+57.94s] DEBUG: Seat vnc1: Stopping; greeter display server failed to start
[+57.94s] DEBUG: Seat vnc1: Stopping
[+57.94s] DEBUG: Seat vnc1: Stopped
设置 VNC 密码后,我还尝试使用“command=Xvnc -SecurityTypes None”和“command=Xvnc -rfbauth /etc/vncpasswd”。日志与上面类似。
我还使用带有 RealVNC 查看器的 Android 平板电脑尝试了第一个配置。这并没有提示输入密码,而是立即报告“连接关闭”。