AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 523152
Accepted
stiv
stiv
Asked: 2019-06-06 13:18:12 +0800 CST2019-06-06 13:18:12 +0800 CST 2019-06-06 13:18:12 +0800 CST

从 Windows10/Centos 连接到 Centos7 后 xrdp 立即断开连接

  • 772

这是我的 xrdp 配置:

[Globals]
ini_version=1
fork=true
port=3389
use_vsock=false
tcp_nodelay=true
tcp_keepalive=true
security_layer=negotiate
crypt_level=high
certificate=
key_file=
ssl_protocols=TLSv1.2, TLSv1.3
autorun=
allow_channels=true
allow_multimon=true
bitmap_cache=true
bitmap_compression=true
bulk_compression=true
max_bpp=128
use_compression=yes
new_cursors=true
use_fastpath=both
blue=009cb5
grey=dedede
ls_top_window_bg_color=009cb5
ls_width=350
ls_height=430
ls_bg_color=dedede
ls_logo_filename=
ls_logo_x_pos=55
ls_logo_y_pos=50
ls_label_x_pos=30
ls_label_width=65
ls_input_x_pos=110
ls_input_width=210
ls_input_y_pos=220
ls_btn_ok_x_pos=142
ls_btn_ok_y_pos=370
ls_btn_ok_width=85
ls_btn_ok_height=30
ls_btn_cancel_x_pos=237
ls_btn_cancel_y_pos=370
ls_btn_cancel_width=85
ls_btn_cancel_height=30
[Logging]
LogFile=xrdp.log
LogLevel=DEBUG
EnableSyslog=true
SyslogLevel=DEBUG
[Channels]
rdpdr=true
rdpsnd=true
drdynvc=true
cliprdr=true
rail=true
xrdpvr=true
tcutils=true
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20

我正在尝试用 mstsc 连接到这台机器(这是在重新启动电脑后,没有人登录):

在此处输入图像描述

在此登录框中,不会发生断开连接:

在此处输入图像描述

在我输入正确的登录名/密码后,我首先出现黑屏,然后关闭 mstsc 窗口。我尝试从 KDE 远程连接应用程序连接,但它也以同样的方式失败。xrdp.log 似乎不包含任何有趣的内容:

[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20190606-04:14:36] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20190606-04:14:36] [DEBUG] return value from xrdp_mm_connect 0
[20190606-04:14:36] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC started connecting
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5910
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC tcp connected
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC password ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connected ok
[20190606-04:14:36] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20190606-04:14:36] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:47744)
[20190606-04:14:37] [DEBUG] Closed socket 20 (AF_UNIX)
[20190606-04:14:37] [DEBUG] Closed socket 12 (AF_INET 127.0.0.1:3389)
[20190606-04:14:37] [DEBUG] xrdp_mm_module_cleanup
[20190606-04:14:37] [DEBUG] VNC mod_exit
[20190606-04:14:37] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:40224)

我该如何解决?

centos windows
  • 8 8 个回答
  • 107386 Views

8 个回答

  • Voted
  1. The Bic Pen
    2021-01-21T13:26:50+08:002021-01-21T13:26:50+08:00

    尝试这个:

    停止xrdp sudo service xrdp stop

    编辑 xrdp 启动脚本: sudo nano /etc/xrdp/startwm.sh

    在这个文件中,替换行

    test -x /etc/X11/Xsession && exec /etc/X11/Xsession
    exec /bin/sh /etc/X11/Xsession
    

    和 startxfce4

    #(您可以通过在开头添加来注释掉行)

    重启xrdp sudo service xrdp start

    选择 Xrdp 作为会话,然后登录。

    • 28
  2. Best Answer
    stiv
    2019-06-06T13:48:16+08:002019-06-06T13:48:16+08:00

    我自己解决了这个问题,希望其他人会发现它有用。我看了一下 ~/.xsession-errors,它包含:

    (imsettings-check:16467): IMSettings-WARNING **: 04:42:56.491: Could not connect: Connection refused
    
    (imsettings-check:16467): GLib-GIO-CRITICAL **: 04:42:56.491: g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
    GLib-GIO-Message: 04:42:56.807: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
    
    ** (process:16260): WARNING **: 04:42:56.824: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refused
    

    然后我用谷歌搜索了一个根本原因,miniconda 安装破坏了 .bashrc 文件中的 PATH,我删除了这一行并修复了它:

        export PATH="/home/stiv/miniconda3/bin:$PATH"
    

    更新:后来我发现x2go,它的工作方式比 XRDP 更可靠、更快。

    • 14
  3. ILGAZ KESKIN
    2019-12-07T07:07:08+08:002019-12-07T07:07:08+08:00
    1. sudo apt-get update

    2. sudo apt install xrdp

    3. sudo apt-get install xserver-xorg-core

    4. sudo apt-get install xorgxrdp

    5. nano /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

    6. 将下面的 polkit 复制到02-allow-colord.conf

    polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.color-manager.create-device" || action.id == "org.freedesktop.color-manager.create-profile" || action.id == "org.freedesktop.color-manager.delete-device" || action.id == "org.freedesktop.color-manager.delete-profile" || action.id == "org.freedesktop.color-manager.modify-device" || action.id == "org.freedesktop.color-manager.modify-profile") && subject.isInGroup("{group}"))
    {
    return polkit.Result.YES;
    }
    });
    
    1. sudo ufw allow 3389/tcp

    2. sudo /etc/init.d/xrdp restart

    3. sudo systemctl status xrdp

    4. sudo systemctl enable xrdp

    5. 注销您的会话。

    6. 尝试使用 RDP

    • 4
  4. Sean Hulbert
    2020-12-13T09:26:28+08:002020-12-13T09:26:28+08:00

    您尝试使用的用户帐户,他们是sudo或wheel组的成员吗?使用 Kali 2020 版本,任何不属于其中的用户sudo都会立即断开连接,我必须终止该用户的所有进程 ( pkill -u <username>),然后删除该用户帐户并重新创建它。当我有时间时,我仍在追查发生这种情况的确切原因。但我想我分享我的经验。

    • 2
  5. Hossein Mirheydari
    2021-05-03T01:51:06+08:002021-05-03T01:51:06+08:00

    您必须执行以下附加操作:

    要配置 Xrdp,首先添加

    exec gnome-session
    

    到配置文件的末尾

    /etc/xrdp/xrdp.ini
    

    或者使用以下命令将“exec gnome-session”添加到“/etc/xrdp/xrdp.ini”配置文件的末尾

    sudo bash -c 'echo "exec gnome-session" >> /etc/xrdp/xrdp.ini'
    

    重新启动 xrdp 以加载新配置

    sudo systemctl restart xrdp
    

    参考: How to: Install Xrdp (Remote Desktop) on CentOS 8 – (How to: Use Windows to remote control CentOS 8)

    • 2
  6. Whereisthespacebar
    2021-04-28T10:02:43+08:002021-04-28T10:02:43+08:00

    我在尝试连接到在红帽企业 Linux 7 上运行 xrdp 的工作机器时遇到了这个问题。我在远程机器上的主文件夹中的基本环境中安装了 miniconda 和 datalad,这破坏了 Windows 远程桌面。解决方案出奇地简单。我卸载了datalad并通过SSH在新环境中重新安装了它。然后我可以通过 Windows 远程桌面重新连接到机器,没有任何问题。

    • 0
  7. user3594395
    2021-06-02T06:18:40+08:002021-06-02T06:18:40+08:00

    在过去的几年里,我花了很多天来解决从 Windows 10 PC 访问 Linux 服务器的间歇性问题。服务器 xrdp.ini 修改的不同方法似乎可以解决问题,但不是永久的。在新的 RHEL8 和 Centos8 安装失败后,所有的 PC RDP 登录都失败了,我观察到以下常见错误。在 PC 失败后,从同一台 PC 的“半”成功重新登录中观察到的错误是可观察到的,systemctl status xrdp其中显示了一系列失败的项目。但是,当使用屏幕、键盘和鼠标直接在服务器上观察时(我旁边有戴尔 R430),systemctl status xrdp,看起来很干净,没有问题。每次使用 Xvnc 重新登录到 RDP,显然都会启动一个单独的 rdp 会话/进程。我得出的结论是,问题出在 PC 上,而且不知何故是 SSL 故障。它在 PC 上一直存在,直到重新启动。服务器不需要重新启动。当然,重新启动 PC 是不切实际的,但它屡屡成功。

    • 0
  8. Stephen Quan
    2021-07-21T15:08:05+08:002021-07-21T15:08:05+08:00

    我也解决了这个问题,而且,似乎仅仅安装 xrdp 包是不够的,因为(1)依赖包不会被安装,(2)startwm.sh 问题。我没有找到完美的解决方案。我注意到其他答案之一是使用我想使用的 xfce4。最后,我默认了更轻量级的东西,即icewm,即

    sudo yum update
    sudo yum install xrdp
    sudo yum install tigervnc-server
    sudo yum install xterm
    sudo yum install icewm
    sudo vi /usr/libexec/xrdp/startwm.sh
    

    而且,实际上,我的startwm.sh脚本顶部有以下内容,即我已经规避或替换了默认行为:

    #!/bin/bash -xe
    /bin/xterm &
    exec /bin/icewm
    
    • 0

相关问题

  • smartmontools - 自动测试是否与运行简短测试相同?

  • systemctl 命令在 RHEL 6 中不起作用

  • 为什么我的交换机没有从指定的池中获取地址

  • 在 CentOS7 GNOME 的 Applications-menu 选项卡中创建自定义菜单

  • 奇怪的路由器与centos 6一起工作[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve