我的主机是 Oracle 服务器上的 Ubuntu 22.04.1 机器,我的客户端是 Ubuntu 20.04.5。使用 Xorg 通过 xrdp 0.9.17 建立连接,没有任何问题。以下本指南,我尝试向主机上的单个用户授予管理员权限。具体来说,我为该用户设置了密码,并创建了文件
/etc/polkit-1/localauthority/50-local.d/46-user-admin.pkla
内容如下:
[Authorize admin control of user settings]
Identity=unix-user:*
Action=org.freedesktop.accounts.*;org.gnome.controlcenter.user-accounts.*
ResultActive=yes
ResultInactive=yes
ResultAny=yes
然后重新启动。在此之后,使用 xrdp 成功登录,屏幕变黑。尝试使用错误的用户或拼写错误的密码登录时,我得到了预期的错误,但使用正确的凭据时,屏幕变黑。SSH 连接工作正常。
我尝试完全删除 xrdp(通常清除并手动擦除几个文件夹)、重新安装、重新配置(将端口协议更改为 tcp)。起初 xrdp 服务的状态正常,但在登录尝试失败后,我收到:
me@me:~$ sudo service xrdp status
xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-11-10 09:35:06 UTC; 2min 9s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Process: 2578 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
Process: 2586 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2587 (xrdp)
Tasks: 1 (limit: 28694)
Memory: 812.0K
CPU: 42ms
CGroup: /system.slice/xrdp.service
└─2587 /usr/sbin/xrdp
Nov 14 09:36:26 me xrdp[2654]: [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 7864320 MB cache entries 2000
Nov 14 09:36:26 me xrdp[2654]: [WARN ] Client Capability: not enough orders supported by client, client wants off screen bitmap but offscreen bitmaps disabled
Nov 14 09:36:26 me xrdp[2654]: [INFO ] Loading keymap file /etc/xrdp/km-00000407.ini
Nov 14 09:36:26 me xrdp[2654]: [WARN ] local keymap file for 0x00000407 found and doesn't match built in keymap, using local keymap file
Nov 14 09:36:26 me xrdp[2654]: [INFO ] connecting to sesman ip x.x.x.x port 3350
Nov 14 09:36:26 me xrdp[2654]: [INFO ] xrdp_wm_log_msg: sesman connect ok
Nov 14 09:36:26 me xrdp[2654]: [INFO ] sesman connect ok
Nov 14 09:36:26 me xrdp[2654]: [INFO ] sending login info to session manager, please wait...
Nov 14 09:36:26 me xrdp[2654]: [ERROR] xrdp_iso_send: trans_write_copy_s failed
Nov 14 09:36:26 me xrdp[2654]: [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
查看 Xorg 会话,有很多条目:
me@me:~$ xauth list
me/unix:11 MIT-MAGIC-COOKIE-1 xxx
me/unix:10 MIT-MAGIC-COOKIE-1 yyy
me/unix:12 MIT-MAGIC-COOKIE-1 zzz
me/unix:13 MIT-MAGIC-COOKIE-1 www
me/unix:14 MIT-MAGIC-COOKIE-1 uuu
我尝试进一步挖掘错误原因trans_write_copy_s failed
,但我认为我的用户出了问题。
我将非常感激您的任何意见。谢谢。