#any host can get a login window

 ここで殆どの設定は終わりました。ただ、この段階では接続時のウインドウ・マネージャの画面がデフォルトのショボイものになってしまいます。。。



 ちょっとこれじゃ、、ですよね。普通の画面を表示させるにはもう1つ設定を行います。

# vi /etc/X11/gdm/gdm.conf
 これでファイルを開き、52 行目を編集します。

#RemoteGreeter=/usr/bin/gdmlogin
 このように設定ファイルはコメントされていますが、

RemoteGreeter=/usr/bin/gdmgreeter
 このようにコメントをはずして、記述も gdmgreeter にします(これを忘れると画面が寂しくなります……)。

 同じく gdm.conf 内で 265 行目を探します

[greeter]
# Greeter has a nice title bar that the user can move
TitleBar=false
# Configuration is available from the system menu of the greeter
ConfigAvailable=false
 この部分を false から true に書き換えます。

ConfigAvailable=true
 引き続き gdm.conf の 210 行目が Enable=false であれば true に書き換えます。

[xdmcp]
# Distributions: Ship with this off. It is never a safe thing to leave
# out on the net. Setting up /etc/hosts.allow and /etc/hosts.deny to only
# allow local access is another alternative but not the safest.
# Firewalling port 177 is the safest if you wish to have xdmcp on.
# Read the manual for more notes on the security of XDMCP.
Enable=true
 この記述を忘れると X のセッションが接続できても、画面が真っ暗になってしまいます*4。

 あとは、良く見慣れたログイン画面で VNC からも接続が可能です。



 最終的に設定を反映させるためにはサーバの再起動が必要です。再起動後に VNC クライアントからの接続を確認します。

# /sbin/reboot

アクセス制限 †
 Xinetd 経由の場合、ネットワークやホストの制限を /etc/hosts.allow /etc/hosts.deny によって比較的簡単に行うことができます。出来ればセキュリティの安全上、設定されておくことをおすすめします。

 まず、/etc/hosts.deny で全ての接続を拒否させるようにします。

# vi /etc/hosts.deny
Xvnc: ALL
 次に /etc/hosts.allow で許可するネットワークやホストを記述します。

Xvnc: .example.jp
Xvnc: 192.168.0.0/16
 接続の成功や拒否されたという記録は /var/log/secure に残ります。