使用RDP对远程Linux机器可能没有意义。从我的观点来看,速度和性能都没有那么好。但在某些情况下,您可能需要在远程Linux上使用桌面,然后此帖子。

1. CentOS 7.

调查系统版本的命令:

uname -r.
CAT / PROC /版本
CAT / etc / OS-释放
lsb_release -a.
注意:LSB_Release命令有时不适用于CentOS

[[email protected] ~]# CAT / etc / OS-释放 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="//www.centos.org/"
BUG_REPORT_URL="//bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[[email protected] ~]# CAT / PROC /版本 Linux. version 3.10.0-1062.12.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Feb 4 23:02:59 UTC 2020
[[email protected] ~]# 

所有命令:

[[email protected] ~]# rpm -Uvh //dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving //dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Preparing...                          ################################# [100%]
        package epel-release-7-12.noarch is already installed
[[email protected] ~]# yum update && yum -y install xrdp tigervnc-server
[[email protected] ~]# systemctl enable xrdp && systemctl restart xrdp
Created symlink from /etc/systemd/system/multi-user.target.wants/xrdp.service to /usr/lib/systemd/system/xrdp.service.
[[email protected] ~]# 

[[email protected] ~]# adduser netsec
[[email protected] ~]# passwd netsec
Changing password for user netsec.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[[email protected] ~]# usermod –aG wheel netsec 
[[email protected] ~]# netstat -an | grep 3389
tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN     
[[email protected] ~]# 

注意:您不必将用户NetSec添加到Wheel组中以通过XRDP登录远程CentOS服务器。它只是为了显示命令。

有很多人在线有一个问题来使用XRDP登录CentOS。它似乎经过身份验证但在Windows计算机上登录CentOS后立即关闭RDP会话。这是因为它们缺少“Gnome桌面”

# yum groups -y install "GNOME Desktop"

或使用轻量级桌面XFCE:

# yum groups -y install "Xfce"

在Logging用户的终端下:

nano ~/.Xclients

然后复制& paste:

#!/bin/bash
XFCE="$(which xfce4-session 2>/dev/null)"
exec "$XFCE"

使它可执行文件:

chmod + x .xclients

并重新启动XRDP服务器:

sudo service xrdp重启

我仍然不知道如何将其默认为所有用户。

YouTube视频:

2. Ubuntu 18.

命令:
sudo apt-get更新
sudo apt-get升级
sudo apt-get安装ubuntu-gnome-desktop
sudo apt-get安装-y xrdp
sudo sed -i's / descker_users =控制台/允许_Users = AnyBody /'/etc/x11/xwrapper.config
sudo nano /etc/polkit-1/localauthority.conf.d/02-allow -colord.conf.conf.conf.d/02-

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

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;
}
});
sudo apt-get安装gnome-tweak-tool -y

YouTube视频用于安装GNOME Desktop GUI和Azure Ubuntu 18.04上的XRDP:

通过命令行检查您的服务器的公共IP:

[[email protected] ~]# curl ifconfig.me
35.226.94.252

参考

经过Jon.

发表评论