Team Phoenix Rising Forums  

Go Back   Team Phoenix Rising Forums > General Computing > *nix and other operating systems

Reply
 
Thread Tools Search this Thread Display Modes
Old 26-05-2005, 01:11   #1
Mojo
Serial 4x4 Offender
 
Mojo's Avatar
 
Join Date: Nov 2001
Location: UK
Posts: 7,317
Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)
Default [Fedora] Run VNC and GDM for headless boxes

You've probably heard of VNC - its a pretty standard remote desktop tool, works under Windows and Linux, amongst others.

GDM? GDM is the blue screen which greets you and takes a username and password to let you login to your Fedora box (and other distributions).

The purpose of this guide is to show you how to get GDM and VNC to play together so that you can VNC to your headless Linux server, login as normal using ANY account (including root), perform your tasks and log off again, killing the session and leaving the box more secure than standard VNC, which leaves your session open.

Firstly, get command-line access to your box, either from the real console or ssh. You'll need to be logged in as root for all the following.

Step 1 - change the X11 config file


The config file is located in /etc/X11/gdm/gdm.conf

Using a text editor, make the following changes:
Locate RemoteGreeter
Change the line to read
RemoteGreeter = /usr/bin/gdmgreeter

Locate [xdmcp]

Change the line following (after the comments) to read
Enable = true
Step 2 - add new services for VNC

The config file is /etc/services

Using a text editor, go to the end of the file and add the following under the comment "Local services"

Code:
vnc800           5900/tcp          #vnc & gdm @ 800x600 resolution
vnc1024          5901/tcp          #vnc & gdm @1024x768 resolution
Step 3 - define the new services

I've attached these files with a .txt extension (to keep the boards happy). They are in Linux format and so will look wierd under windows but if you drop them on your Linux box in /etc/xinetd.d/ and strip off the extension they'll work

Change directory to /etc/xinetd.d/
I used vi for the following, any plain-text editor will do

Create file vnc800

Contents:

Code:
service vnc800
{
disable		=	no
socket-type	=	stream
protocol	=	tcp
group           =       tty
wait		=	no
user		=	nobody
server		=	/usr/bin/Xvnc
server_args	=	-inetd -query localhost -geometry 800x600 -depth 16 -once -fp unix/:7100 -securitytypes=none
}
Or basically, when someone uses TCP to access port 5900 (which is basically what VNCViewer Server:0 does), fire up Xvnc, screen size/depth 800x600x16 and don't ask for VNC password - there's no need GDM will ask us for our login name & password.

Create file vnc1024

Contents:

Code:
service vnc1024
{
disable		=	no
socket-type	=	stream
protocol	=	tcp
group           =       tty
wait		=	no
user		=	nobody
server		=	/usr/bin/Xvnc
server_args	=	-inetd -query localhost -geometry 1024x768 -depth 16 -once -fp unix/:7100 -securitytypes=none
}
Exactly the same apart from the service name and screen geometry, so cp vnc800 vnc1024 save some typing

You could, of course, carry on with different screen resolutions and colour depths, just make sure the entries in /etc/services match the new service files in /etc/xinetd.d/. Port numbers would be 5902, 5903, 5904......

Step 4 - Turn off vncserver

We don't want a vnc server now, so make sure it doesn't run with

chkconfig --level 2345 vncserver off

And then instigate all this with

init 3
init 5
service xinetd restart


And all should be complete.

Step 5 - testing

Use your normal vncviewer to access the box. I'll use an example box with an IP of 192.168.0.20.

vncviewer 192.168.0.20:0 should not ask for a password, give you a normal Fedora login screen @ 800x600, and let you use any valid login for the box

vncviewer 192.168.0.20:1 should do exactly the same but at 1024x768


E&OE, tested and working on Fedora Core 2 & 3

Tip: Log in as root, remove desktop background, change colour to red, and then you'll know you're logged in as root for this session.
Tip2: If you run firewall you might need to open ports 5900 & 5901 to tcp access
Tip3: I've found sometimes FC2 needs a reboot, FC3 doesn't need one - anyway if you get a connection but blank screen under FC2 try a restart
Tip4: K12LTSP servers come pre-installed with this -
servername:0 gives you 1024x768x16
Tip5: If your Linux server is not on a secure network (why not? Never heard of smoothwall?) you may not want to do this. SSH to the box and start your VNC server that way - much more secure.
Attached Images
File Type: gif untitled.GIF (47.1 KB, 44 views)
File Type: gif untitled2.GIF (17.3 KB, 31 views)
File Type: gif untitled3.GIF (66.2 KB, 28 views)
Attached Files
File Type: txt vnc800.txt (226 Bytes, 47 views)
File Type: txt vnc1024.txt (228 Bytes, 22 views)

Last edited by Mojo; 21-06-2005 at 21:42.
Mojo is offline   Reply With Quote
Old 21-06-2005, 21:41   #2
Mojo
Serial 4x4 Offender
 
Mojo's Avatar
 
Join Date: Nov 2001
Location: UK
Posts: 7,317
Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)Mojo has much to be proud of (1000+)
Default

Update for Fedora Core 4

The above didn't work for me.
It appears on x86-64 Fedora Core 4 doesn't install xinetd

So, before running the above you need to install this.

Procedure:
  1. Log into the machine as root and get to a console
  2. Type in yum install xinetd
  3. Answer yes when prompted
  4. When yum exits successfully, type in chkconfig --level 2345 xinetd on
  5. Type in service xinetd start

This should solve the problem, it did for me

Last edited by Mojo; 22-06-2005 at 00:24.
Mojo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:17.


Powered by: vBulletin Version 3.8.4, Copyright ©2000 - 2010, Jelsoft Enterprises Limited.