xrdp はオープンソースのリモートデスクトッププロトコルサーバーであり、WindowsマシンからLinuxサーバーにRDPすることができます。 rdesktop、freerdp、およびリモートデスクトップクライアントからの接続を受け入れることができます。
この投稿は、 CentOS 7 / RHEL 7でxrdpサーバーをセットアップするのに役立ちます 。
前提条件
1.まず、 CentOS 7 /RHEL7にGnomeGUIをインストールします
2. xrdpはEPELリポジトリで利用できるため、EPELリポジトリをインストールして構成します 。
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
CentOS7にxrdpをインストールする
YUMコマンドを使用します CentOS 7 /RHEL7にxrdpパッケージをインストールするには
yum -y install xrdp tigervnc-server
出力:
Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.excellmedia.net * epel: del-mirrors.extreme-ix.org * extras: centos.excellmedia.net * updates: centos.excellmedia.net Resolving Dependencies --> Running transaction check ---> Package tigervnc-server.x86_64 0:1.8.0-2.el7_4 will be installed ---> Package xrdp.x86_64 1:0.9.5-1.el7 will be installed --> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.5-1.el7.x86_64 --> Running transaction check ---> Package xorgxrdp.x86_64 0:0.2.5-3.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================= Package Arch Version Repository Size ================================================================================================= Installing: tigervnc-server x86_64 1.8.0-2.el7_4 updates 213 k xrdp x86_64 1:0.9.5-1.el7 epel 413 k Installing for dependencies: xorgxrdp x86_64 0.2.5-3.el7 epel 61 k Transaction Summary ================================================================================================= Install 2 Packages (+1 Dependent package) Total download size: 688 k Installed size: 2.7 M Downloading packages: warning: /var/cache/yum/x86_64/7/epel/packages/xrdp-0.9.5-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY Public key for xrdp-0.9.5-1.el7.x86_64.rpm is not installed (1/3): xrdp-0.9.5-1.el7.x86_64.rpm | 413 kB 00:00:01 (2/3): tigervnc-server-1.8.0-2.el7_4.x86_64.rpm | 213 kB 00:00:01 (3/3): xorgxrdp-0.2.5-3.el7.x86_64.rpm | 61 kB 00:00:01 ------------------------------------------------------------------------------------------------- Total 409 kB/s | 688 kB 00:00:01 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 Importing GPG key 0x352C64E5: Userid : "Fedora EPEL (7) <[email protected]>" Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5 Package : epel-release-7-11.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : xorgxrdp-0.2.5-3.el7.x86_64 1/3 Installing : 1:xrdp-0.9.5-1.el7.x86_64 2/3 Installing : tigervnc-server-1.8.0-2.el7_4.x86_64 3/3 Verifying : xorgxrdp-0.2.5-3.el7.x86_64 1/3 Verifying : tigervnc-server-1.8.0-2.el7_4.x86_64 2/3 Verifying : 1:xrdp-0.9.5-1.el7.x86_64 3/3 Installed: tigervnc-server.x86_64 0:1.8.0-2.el7_4 xrdp.x86_64 1:0.9.5-1.el7 Dependency Installed: xorgxrdp.x86_64 0:0.2.5-3.el7 Complete! </[email protected]>
xrdpがインストールされたら、次のコマンドを使用してxrdpサービスを開始します。
systemctl start xrdp
xrdpは3389でリッスンしているはずです。これはnetstat
を使用して確認できます。 コマンド。
netstat -antup | grep xrdp
出力:
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1508/xrdp tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1507/xrdp-sesman
読む :CentOS 7 / RHEL 7でnetstatコマンドが見つかりません–クイックフィックス
デフォルトでは、xrdpサービスはシステムの再起動後に自動的に開始されません。ターミナルで次のコマンドを実行して、システムの起動時にサービスを有効にします。
systemctl enable xrdp
ファイアウォール
外部マシンからのRDP接続を許可するようにファイアウォールを構成します。次のコマンドは、RDPポート(3389)の例外を追加します。
firewall-cmd --permanent --add-port=3389/tcp firewall-cmd --reload
SELinux
SELinuxを構成する
chcon --type=bin_t /usr/sbin/xrdp chcon --type=bin_t /usr/sbin/xrdp-sesman
xrdpリモート接続のテスト
次に、リモートデスクトップ接続を使用して任意のWindowsマシンからRDPを取得します。 [コンピューター]フィールドにLinuxサーバーのIPアドレスを入力し、[接続]をクリックします。
![](https://m.unixlinux.online/article/uploadfiles/202204/2022042710263649.jpg)
RDP証明書名の不一致の警告を無視する必要がある場合があります。
![](https://m.unixlinux.online/article/uploadfiles/202204/2022042710263733.jpg)
ユーザー名とパスワードの入力を求められます。 rootまたはシステム上にある任意のユーザーのいずれかを使用できます。モジュール「Xvnc
」を使用していることを確認してください 「。
![](https://m.unixlinux.online/article/uploadfiles/202204/2022042710263780.jpg)
[OK]をクリックすると、処理が表示されます。 30分以内に、デスクトップが手に入ります。
![](https://m.unixlinux.online/article/uploadfiles/202204/2022042710263823.jpg)
それで全部です。 CentOS 7 / RHEL 7でxRDPが正常に構成されました 。