プロが教える店舗&オフィスのセキュリティ対策術

サーバー側としてREDHAT 8.0 を使用しております。
VNCはCD内の vnc-server-3.3.3r2-39.i386.rpmをインストールしました。
ターミナルより #vncserver と入力し、パスワードも2度入力しました。

クライアント側はW2KでVIEWERのみインストールしています。

VIEWを起動して、サーバー側のIPを入力すると
「Failed to connect to server」と表示され、
繋がりません。

色々と調べたのですが、それぞれが違う方法が書かれていて、どれが正しいのか良く分かりません。
初心者ですが、宜しくお願いいたします。

A 回答 (7件)

(動作検証ご報告)


RedHat8.0にVncserverを入れ、Windows2Kより接続したら、あっけなくつながったので取り敢えずご報告します。


●~/.vnc/xstartupの中身(xstartupに実行権はありますよね?)
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
#/usr/bin/startkde &
/usr/bin/gnome-session &

●RedHat側のserver起動方法
$ vncserver -geometry 800x600 -depth 16

●vncserver起動時のログ結果
26/12/02 09:54:45 Xvnc version 3.3.6 - built Dec 2 2002 10:54:00
26/12/02 09:54:45 Copyright (C) 2002 RealVNC Ltd.
26/12/02 09:54:45 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
26/12/02 09:54:45 All Rights Reserved.
26/12/02 09:54:45 See http://www.realvnc.com for information on VNC
26/12/02 09:54:45 Desktop name 'X' (localhost:1)
26/12/02 09:54:45 Protocol version supported 3.3
26/12/02 09:54:45 Listening for VNC connections on TCP port 5901
26/12/02 09:54:45 Listening for HTTP connections on TCP port 5801
26/12/02 09:54:45 URL http://localhost:5801
_IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root
SESSION_MANAGER=local/localhost:/tmp/.ICE-unix/1158

●クライアント接続時のログ
26/12/02 10:02:26 Got connection from client 10.XXX.XXX.XXX
26/12/02 10:02:26 Protocol version 3.3
26/12/02 10:02:28 Pixel format for client 10.XXX.XXX.XXX:
26/12/02 10:02:28 8 bpp, depth 8
26/12/02 10:02:28 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
26/12/02 10:02:28 Using ZRLE encoding for client 10.253.251.136
26/12/02 10:02:29 Pixel format for client 10.253.251.136:
26/12/02 10:02:29 16 bpp, depth 16, little endian
26/12/02 10:02:29 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
26/12/02 10:02:29 no translation needed
26/12/02 10:02:29 Using hextile encoding for client 10.XXX.XXX.XXX
(IPアドレスは伏せ字)

とりあえず以上です。
    • good
    • 0
この回答へのお礼

お返事ありがとうございます。

$ vncserver -geometry 800x600 -depth 16
にて起動したところ、起動できました。

$ vncserver -geometry 800x600 や
$ vncserver -geometry
は試していたのですが、 -depth を入れていませんでした。

本当にありがとうございました。
とても助かりました。
皆様 丁寧にアドバイス頂きありがとうございました。

お礼日時:2002/12/26 10:51

>IPアドレスとセッション番号を入力し、


>パスワードを入力し、画面が表示されるまでは
>進んだのですが、その後、灰色の画面のままで、
>何も表示されません。

~/.vnc/xstartupはどうなってますか?ウィンドウマネージャを起動するように編集しましたか?
以下は私のxstartupです。TurboLinuxなのでKDEですが、GNOMEなら
/usr/bin/gnome-session &
だったかな?
maitonさんの場合、xsetroot -solid greyで止まっているのでは?

---------------------------------------------------
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

#/usr/bin/startkde &
---------------------------------------------------

この回答への補足

お返事ありがとうございます。

教えていただいた通りに編集し、
起動してみましたが、同様に灰色画面で止まります。

/usr/bin を外してみたり、 &を外してみたり
色々と試してみましたが、同様でした。

#!/bin/sh

# Red Hat Linux VNC session startup script
#exec /etc/X11/xinit/xinitrc


[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
/usr/bin/gnome-session &

補足日時:2002/12/26 02:50
    • good
    • 0

灰色の画面というのは、X window system の root window が表示されて


るんだと思うので、接続できているのでは?

ちゃんと使うには、

~/.vnc/xstartup

に、いろいろ書かないといけないんじゃありませんでしたっけ?

とりあえず、

exec kterm

とか書いてみるとどうなります?

この回答への補足

お返事ありがとうございます。

試してみたところ、
コマンド画面としてVNCVIEWERが起動しました。

補足日時:2002/12/26 02:35
    • good
    • 0

以下は、私の動作している環境のログです。


# /root/.vnc/pent5:1.logの様にログがあります。参考にしてください。
また、リモートの前に、 Linux側でも、確認ができますので、まずは、 Linux側が完全に動作することを確認してください。
# /usr/bin/vncviewer
です。

24/12/02 22:20:38 Xvnc version 3.3.3r2+tight1.2.2
24/12/02 22:20:38 Copyright (C) AT&T Laboratories Cambridge.
24/12/02 22:20:38 All Rights Reserved.
24/12/02 22:20:38 See http://www.uk.research.att.com/vnc for information on VNC
24/12/02 22:20:38 Desktop name 'X' (pent5:1)
24/12/02 22:20:38 Protocol version supported 3.3
24/12/02 22:20:38 Listening for VNC connections on TCP port 5901
24/12/02 22:20:38 Listening for HTTP connections on TCP port 5801
24/12/02 22:20:38 URL http://pent5:5801

24/12/02 22:21:08 Got connection from client 192.168.1.11
24/12/02 22:21:08 Protocol version 3.3
24/12/02 22:21:11 Pixel format for client 192.168.1.11:
24/12/02 22:21:11 8 bpp, depth 8
24/12/02 22:21:11 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/12/02 22:21:11 no translation needed
24/12/02 22:21:11 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/12/02 22:21:11 Using hextile encoding for client 192.168.1.11
24/12/02 22:21:12 Pixel format for client 192.168.1.11:
24/12/02 22:21:12 8 bpp, depth 8
24/12/02 22:21:12 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/12/02 22:21:12 no translation needed
24/12/02 22:21:12 Using hextile encoding for client 192.168.1.11
24/12/02 22:21:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
SESSION_MANAGER=local/pent5:/tmp/.ICE-unix/6207
aumix: error opening mixer

Gtk-WARNING **: invalid cast from (NULL) pointer to `GtkOptionMenu'

Gtk-CRITICAL **: file gtkoptionmenu.c: line 248 (gtk_option_menu_set_history): assertion `option_menu != NULL' failed.
AUDIT: Tue Dec 24 22:21:33 2002: 6203 Xvnc: client 5 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: Client is not authorized to connect to Server
xscreensaver: Can't open display: :1
xscreensaver: initial effective uid/gid was root/root (0/0)
xscreensaver: running as nobody/nobody (99/99)

xscreensaver: This is probably because you're logging in as root. You
shouldn't log in as root: you should log in as a normal user,
and then `su' as needed. If you insist on logging in as
root, you will have to turn off X's security features before
xscreensaver will work.

Please read the manual and FAQ for more information:

http://www.jwz.org/xscreensaver/faq.html
http://www.jwz.org/xscreensaver/man.html


Gtk-WARNING **: gtk_signal_disconnect_by_data(): could not find handler containing data (0x81B5940)

Gtk-WARNING **: gtk_signal_disconnect_by_data(): could not find handler containing data (0x819F948)

GnomeVFS-WARNING **: Invalid byte sequence in conversion input

GnomeVFS-WARNING **: Unable to convert アドレスカード from UTF-8 to EUC-JP, this string will p
robably display wrong: 無効または不完全なマルチバイトまたはワイド文字です

GnomeVFS-WARNING **: Invalid byte sequence in conversion input

GnomeVFS-WARNING **: Unable to convert カレンダ情報 from UTF-8 to EUC-JP, this string will p
robably display wrong: 無効または不完全なマルチバイトまたはワイド文字です

GnomeVFS-WARNING **: Invalid byte sequence in conversion input

GnomeVFS-WARNING **: Unable to convert カレンダ情報 from UTF-8 to EUC-JP, this string will p
robably display wrong: 無効または不完全なマルチバイトまたはワイド文字です
24/12/02 22:32:56 Client 192.168.1.11 gone
24/12/02 22:32:56 Statistics:
24/12/02 22:32:56 key events received 0, pointer events 457
24/12/02 22:32:56 framebuffer updates 499, rectangles 1227, bytes 850908
24/12/02 22:32:56 copyRect rectangles 1, bytes 16
24/12/02 22:32:56 hextile rectangles 1226, bytes 850892

24/12/02 22:32:56 raw bytes equivalent 3632950, compression ratio 4.269578
24/12/02 22:33:40 httpd: get '' for 192.168.1.11
24/12/02 22:33:40 httpd: defaulting to 'index.vnc'
24/12/02 22:33:49 httpd: get 'vncviewer.jar' for 192.168.1.11
24/12/02 22:33:49 httpd: get 'vncviewer.jar' for 192.168.1.11
24/12/02 22:33:52 httpd: get 'default.class' for 192.168.1.11
24/12/02 22:33:52 httpProcessInput: open: No such file or directory
24/12/02 22:33:52 httpd: get 'default.class' for 192.168.1.11
24/12/02 22:33:52 httpProcessInput: open: No such file or directory
24/12/02 22:33:52 asking for file in other directory
24/12/02 22:33:52 asking for file in other directory
24/12/02 22:33:52 asking for file in other directory
24/12/02 22:33:52 asking for file in other directory

24/12/02 22:33:57 Got connection from client 192.168.1.11
24/12/02 22:33:57 Protocol version 3.3
24/12/02 22:33:57 Using tight encoding for client 192.168.1.11
24/12/02 22:33:57 Enabling X-style cursor updates for client 192.168.1.11
24/12/02 22:33:57 Enabling LastRect protocol extension for client 192.168.1.11
24/12/02 22:33:57 Pixel format for client 192.168.1.11:
24/12/02 22:33:57 8 bpp, depth 8
24/12/02 22:33:57 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/12/02 22:33:57 no translation needed
24/12/02 22:34:41 httpd: get 'vncviewer.jar' for 192.168.1.11
24/12/02 22:34:41 Client 192.168.1.11 gone
24/12/02 22:34:41 Statistics:
24/12/02 22:34:41 key events received 6, pointer events 231
24/12/02 22:34:41 framebuffer updates 2, rectangles 17, bytes 3976
24/12/02 22:34:41 LastRect markers 2, bytes 24
24/12/02 22:34:41 cursor shape updates 1, bytes 82
24/12/02 22:34:41 tight rectangles 14, bytes 3870
24/12/02 22:34:41 raw bytes equivalent 835656, compression ratio 215.931783

24/12/02 22:34:44 Got connection from client 192.168.1.11
24/12/02 22:34:44 Protocol version 3.3
24/12/02 22:34:44 Using tight encoding for client 192.168.1.11
24/12/02 22:34:44 Enabling X-style cursor updates for client 192.168.1.11
24/12/02 22:34:44 Enabling LastRect protocol extension for client 192.168.1.11
24/12/02 22:34:44 Pixel format for client 192.168.1.11:
24/12/02 22:34:44 8 bpp, depth 8
24/12/02 22:34:44 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/12/02 22:34:44 no translation needed
24/12/02 22:37:26 rfbProcessClientNormalMessage: read: Connection reset by peer
24/12/02 22:37:26 Client 192.168.1.11 gone
24/12/02 22:37:26 Statistics:
24/12/02 22:37:26 key events received 14, pointer events 390
24/12/02 22:37:26 framebuffer updates 52, rectangles 317, bytes 29878
24/12/02 22:37:26 LastRect markers 13, bytes 156
24/12/02 22:37:26 cursor shape updates 18, bytes 1402
24/12/02 22:37:26 tight rectangles 286, bytes 28320
24/12/02 22:37:26 raw bytes equivalent 1611419, compression ratio 56.900388

25/12/02 06:15:48 Got connection from client 127.0.0.1
25/12/02 06:15:48 Protocol version 3.3
25/12/02 06:16:01 Pixel format for client 127.0.0.1:
25/12/02 06:16:01 16 bpp, depth 16, little endian
25/12/02 06:16:01 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0

!!!!!!!!!!!!!!!!!!!

この部分です。
25/12/02 06:15:48 Got connection from client 127.0.0.1
25/12/02 06:15:48 Protocol version 3.3
25/12/02 06:16:01 Pixel format for client 127.0.0.1:
25/12/02 06:16:01 16 bpp, depth 16, little endian
25/12/02 06:16:01 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
25/12/02 06:16:01 Using raw encoding for client 127.0.0.1
25/12/02 06:16:01 Using compression level 1 for client 127.0.0.1
25/12/02 06:16:01 Enabling X-style cursor updates for client 127.0.0.1
25/12/02 06:16:01 Enabling LastRect protocol extension for client 127.0.0.1
25/12/02 06:16:58 Client 127.0.0.1 gone
25/12/02 06:16:58 Statistics:
25/12/02 06:16:58 key events received 0, pointer events 923
25/12/02 06:16:58 framebuffer updates 24, rectangles 52, bytes 2394736
25/12/02 06:16:58 cursor shape updates 10, bytes 812
25/12/02 06:16:58 raw rectangles 42, bytes 2393924
25/12/02 06:16:58 raw bytes equivalent 2393924, compression ratio 1.000000

!!!!!!!!!!!!!!!!!!!!!!

今朝起動した部分です。

もし、よろしければ、あなたのログをはりつけてみませんか?
なにか、分かるかも知れません。
2年程前にやったことなので、的外れなところがあり、プロの人から見ると、笑われるかも知れません。今回、私も、構築の部分を再度、明文化してみたいと思っています。

このように、vncviewerを全て、コマンドラインからも実行できるです。

この回答への補足

お返事ありがとうございます。

LINUX側から
/usr/bin/vncviewer
と入力したところ、
ERROR: Can't open display:
と表示されました。

補足日時:2002/12/26 02:42
    • good
    • 0
この回答へのお礼

ログを掲載してみます。
お願いします。


26/12/02 02:40:21 Xvnc version 3.3.3r2+tight1.2.2
26/12/02 02:40:21 Copyright (C) AT&T Laboratories Cambridge.
26/12/02 02:40:21 All Rights Reserved.
26/12/02 02:40:21 See http://www.uk.research.att.com/vnc for information on VNC
26/12/02 02:40:21 Desktop name 'X' (hotel.mine.nu:1)
26/12/02 02:40:21 Protocol version supported 3.3
26/12/02 02:40:21 Listening for VNC connections on TCP port 5901
26/12/02 02:40:21 Listening for HTTP connections on TCP port 5801
26/12/02 02:40:21 URL http://hotel.mine.nu:5801
gnome-session: you're already running a session manager

26/12/02 02:40:29 Got connection from client 192.168.0.2
26/12/02 02:40:29 Protocol version 3.3
26/12/02 02:40:32 Pixel format for client 192.168.0.2:
26/12/02 02:40:32 8 bpp, depth 8
26/12/02 02:40:32 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
26/12/02 02:40:32 no translation needed
26/12/02 02:40:32 rfbProcessClientNormalMessage: ignoring unknown encoding 16
26/12/02 02:40:32 Using hextile encoding for client 192.168.0.2

お礼日時:2002/12/26 02:53

>IPアドレスとセッション番号を入力し、


>パスワードを入力し、画面が表示されるまでは
>進んだのですが、その後、灰色の画面のままで、
>何も表示されません。

Linux側のColor Depthが大きすぎるのでは無いかと思います。
私のシステムでは、
一台はATI Radeon 9000 128M最大のColor Depthにしてあります。これは、語指摘の様に、グレーの表示しかできません。

もう一台はノートPCです。こちらは、グラフィックメモリの関係でもっと小さなColor Depthです。こちらは、問題なく表示されます。

余談ですが、JREの環境を組み込んであれば、ブラウザーから、
http://xxx.xxx.xxx.xxx:5801←この部分はシステムにより異なります。

/root/.vnc/yyyyy:1.logのファイルにログがはきだされていますので、xxx.xxx.xxx.xxx:5801の様に、ポート番号が表示されています。

viewer側で、コンソールを開いて、xclockや、xcalcなどを起動できます。

この回答への補足

ご回答ありがとうございます。
16bitになっていたので、256色に
スクリーンも 800*600に変更してみましたが、
同様に灰色の画面のままです。

サイズを小さくしたのに、どうやら表示されている
灰色の画面のサイズは同じような気がします。

LinuxのXwindow上から単にディスプレイの設定を
変更するだけではだめなのでしょうか?

何度も済みませんが、宜しくお願いいたします。

補足日時:2002/12/24 23:26
    • good
    • 0

設定の一例ですので、必ずしもおなじではありません。


RedHat側

# /usr/bin/vncserve

You will require a password to access your desktops.

Password:******
Verify:******

New 'X' desktop is localhost.localdomain:1 ←この数字に注目(セッション番号)

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

# /root/.vnc/xstartup
を実行する毎に、複数のセッションが起動するので、セション番号がカウントアップされます。

クライアント側でも、実行可能。ただし、ピクセルの関係で開けない場合もあります。

RedHat側でも、確認可能。ただし、ピクセルの関係で開けない場合もあります。
# /root/bin/vncviewer
ServerDialog

VNC Server:xxx.xxx.xxx.xxx:y
xxx.xxx.xxx.xxx ←サーバIPアドレス。名前が解決できるのであれば、エイリアス。
y:1 ←セッション番号

passwordDialog
Password:先に入力した、パスワード
これで、
'X' desktop is localhost.localdomain:1

Win2K側
VNC Viewer
Connection details
VNC server:xxx.xxx.xxx.xxx:y

VNC Authentication
Session password:先に入力した、パスワード

>VIEWを起動して、サーバー側のIPを入力すると
「Failed to connect to server」と表示され、
繋がりません。

IPアドレスの後ろに、":"と、セッション番号が抜けているのでは?

この回答への補足

>IPアドレスの後ろに、":"と、セッション番号が抜けているのでは?

セッション番号が抜けていました。
ありがとうございました。

IPアドレスとセッション番号を入力し、
パスワードを入力し、画面が表示されるまでは
進んだのですが、その後、灰色の画面のままで、
何も表示されません。

もしなにかご存知でしたら、宜しくお願いいたします。

補足日時:2002/12/24 18:48
    • good
    • 0

>色々と調べたのですが、それぞれが違う方法が書かれていて、どれが正しいのか良く分かりません。


どれも正しい方法と思いますよ。正解は一つとは限らないので。
それで解決するかどうかは、別の話ですが。

サーバー側でプロセスが立ち上がっているか、
ポートがListenされているか、
ログが出力されてないか、
クライアントからtelnetでつなげられるか、

――など試されてみては。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!