Ubuntu 24.04
Sponsored Link

デスクトップ環境 : GNOME リモートデスクトップ2025/05/16

 

GNOME リモートデスクトップサービスを設定して、クライアントコンピューターからリモート接続できるようにします。

[1] GNOME デスクトップ インストール済みの場合は依存関係ですでにインストールされていますが、未インストールの場合は以下のようにしてインストールします。
root@dlp:~#
apt -y install gnome-remote-desktop
[2]

各ユーザー自身でリモートデスクトップを有効にする場合は、デスクトップにログインして以下のように設定します。
ただし、設定したユーザーがログアウトすると rdp ポートはリスンしなくなります。

[設定] - [システム] - [リモートデスクトップ] を開くと以下の画面になります。
ここで、[デスクトップ共有] と [リモートコントロール] を有効にします。

ポートは RDP 既定の [3389] ポートが設定されていますが、他ユーザーがすでに使用中の場合は、他のポートに変更します。
ログインユーザーとパスワードは、RDP 接続用のユーザー名とパスワードを設定します。
[3] クライアントコンピューターからの接続です。Windows 11 を例にします。
リモートデスクトップ接続を起動して接続すると、ユーザー名とパスワードの入力画面になります。
ここで、[3] で設定したユーザー名とパスワードを入力します。
[4] 認証に成功すると、リモートデスクトップの画面が表示されます。
[5] root 権限でリモートデスクトップを有効にする場合は以下のように設定します。
この場合、リモートデスクトップサービスに接続するユーザー名とパスワードは共通で、接続後に通常のログイン画面が表示され、各ユーザーは自身の OS ユーザー名とパスワードでログインします。
# 証明書作成

root@dlp:~#
mkdir -p /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop

root@dlp:~#
cd /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop

root@dlp:/var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop#
openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp384r1) -keyout tls.key -out tls.crt -days 3650

-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:JP
State or Province Name (full name) []:Hiroshima
Locality Name (eg, city) [Default City]:Hiroshima
Organization Name (eg, company) [Default Company Ltd]:GTS
Organizational Unit Name (eg, section) []:Server World
Common Name (eg, your name or your server's hostname) []:dlp.srv.world
Email Address []:root@srv.world

root@dlp:/var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop#
chown -R gnome-remote-desktop:gnome-remote-desktop /var/lib/gnome-remote-desktop/.local

root@dlp:/var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop#
# RDP を有効にする
# [Init TPM credentials ***] メッセージは問題ない
# TPM デバイスを搭載していない古いコンピューターでは表示される

root@dlp:~#
grdctl --system rdp set-tls-key /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key

Init TPM credentials failed because No TPM device found, using GKeyFile as fallback.
root@dlp:~#
grdctl --system rdp set-tls-cert /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt
# RDP 接続ユーザーを設定
# set-credentials [任意のユーザー名] [パスワード]

root@dlp:~#
grdctl --system rdp set-credentials rdpuser password

root@dlp:~#
grdctl --system rdp enable

root@dlp:~#
grdctl --system status

Init TPM credentials failed because No TPM device found, using GKeyFile as fallback.
Overall:
        Unit status: active
RDP:
        Status: enabled
        Port: 3389
        TLS certificate: /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt
        TLS fingerprint: b5:73:d5:63:83:9a:09:d5:89:75:e7:39:51:dd:2a:7c:41:c5:d0:35:ad:41:5e:fe:45:c6:94:05:2e:0b:30:75
        TLS key: /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key
        Username: (hidden)
        Password: (hidden)

root@dlp:~#
systemctl daemon-reload

root@dlp:~#
systemctl restart gnome-remote-desktop

[6] クライアントコンピューターからの接続です。Windows 11 を例にします。
リモートデスクトップ接続を起動して接続すると、ユーザー名とパスワードの入力画面になります。
ここで、[5] で設定した RDP 接続ユーザーとパスワードを入力します。
[7] リモートデスクトップ接続に成功すると、ログイン画面が表示されます。
ここで、自身の OS ユーザーでログインします。ログイン後は通常のリモートデスクトップ操作と同じです。
関連コンテンツ