インストールするサーバの情報は下記の通りです。
OS:CentOS Linux release 7.4.1708 (Core)
EPELリポジトリを有効化する。
# yum -y install epel-release.noarch
補足)EPELリポジトリとは
CentOS標準のリポジトリでは提供されていないパッケージを
yumコマンドでインストールを可能にするリポジトリらしいです。
xrdpとtigervnc-serverをインストールする。
# yum -y install --enablerepo=epel xrdp tigervnc-server
以下の操作により日本語キーボードを導入する。
# cd /etc/xrdp
# wget http://www.mail-archive.com/xrdp-devel@lists.sourceforge.net/msg00263/km-e0010411.ini
# cp km-e0010411.ini km-0411.ini
# cp km-e0010411.ini km-e0200411.ini
# cp km-e0010411.ini km-e0210411.ini
以下の操作でサービスを起動し、自動起動を有効化する。
# systemctl start xrdp.service
# systemctl enable xrdp.service
以下の操作でRDPで使うポートへの接続を許可する。
# firewall-cmd --zone=public --add-port=3389/tcp
# firewall-cmd --permanent --zone=public --add-port=3389/tcp
「カラープロファイルを作成するには認証が必要です」と
表示された場合の対策です。
下記の設定をすると、管理者パスワードの入力を求められなくなります。
# vi /etc/polkit-1/rules.d/02-colord.rules
---------------------------------------------------------------------------------
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") {
return polkit.Result.YES;
}
});
---------------------------------------------------------------------------------
クライアントからリモートデスクトップサーバへ接続する。
問題がなければ、CentOSのデスクトップ画面が表示されます。
# chkconfig --level 3 xrdp on
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -s 192.168.128.0/24 -j ACCEPT
# iptables -L
# service iptables save
# service iptables restart
# iptables -L
※FireWallの設定方法参考
https://help.sakura.ad.jp/hc/ja/articles/206208121