LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-20-2009, 04:39 PM   #1
Esjjay
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
How to allow more that two user connections to vncserver


I have set up vncserver successfully on Cent OS 5 virtual server (for testing purposes) and am attempting to connect using RealVNC or TightVNC. I can easily bring up the :1 and :2 sessions but cannot get the :3 and :4 sessions to work. I always get a connection refused type of message. I have checked the ports 5901 - 5904 and they are actively listening :

netstat -an | grep 590
tcp 0 0 127.0.0.1:5901 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5902 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5903 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5904 0.0.0.0:* LISTEN

I have made sure that the vncserver file in /etc/sysconfig is set up correctly:

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:larry 2:moe 3:curly 4:steve"
VNCSERVERARGS[1]="-geometry 1024x768 -localhost -AlwaysShared"
VNCSERVERARGS[2]="-geometry 1024x768 -localhost -AlwaysShared"
VNCSERVERARGS[3]="-geometry 1024x768 -localhost -AlwaysShared"
VNCSERVERARGS[4]="-geometry 1024x768 -localhost -AlwaysShared"

I have set the export DISPLAY for all users to their corresponding session:

larry -- DISPLAY=localhost:1
moe -- DISPLAY=localhost:2
curly -- DISPLAY=localhost:3
steve -- DISPLAY=localhost:4

Obviously I am using SSH tunneling. I have set up identical /home/<user>/.vnc/xstartup files:

#!/bin/sh

( while true; do xterm; done ) &
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
gnome-session &

The log files at /home/<user>/.vnc/CentOS5.ihs.org:1.log are ugly and too large to copy here. The one thing I noticed in ALL of the log files are the statements "No profile for user 'larry' found" (or moe or curly or steve). But the sessions for larry and moe seem to work just fine.

Any suggestions? I must be missing something simple but I can't seem to find it.
 
Old 10-21-2009, 08:52 AM   #2
SethsdadtheLinuxer
Member
 
Registered: Jun 2007
Posts: 152

Rep: Reputation: 37
could be a firewall issue. Have you tried disabling 1 or 2 to see if 3 or 4 works then?
 
Old 10-21-2009, 09:34 AM   #3
Esjjay
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Tried that -- I think.

I disabled the firewall by simply entering:

service iptables stop

Then tried it again with the same results. (I can disable the firewall safely since everything I am doing is behind our firewall.)

I disable 1 and 2 by:

login as larry (and moe, who are :1 and :2 respectively) and

'vncserver -kill :1' and 'vncserver -kill :2'

When I do that and try to connect with :1 or :2, I get a "connection is closed unexpectedly" type of popup message. When I attempt with :3 or :4, I get "Attempting to connect to host" and "Unable to connect to host: Connection refused (10061)" type of popups with RealVNC.

Any more ideas?
 
Old 10-21-2009, 09:54 AM   #4
reickler
LQ Newbie
 
Registered: Sep 2009
Posts: 29

Rep: Reputation: 20
it's not likely that it's a firewall issue if youre using an ssh tunnel and connecting to localhost. Are you forwarding all four ports when you make the tunnel?
 
Old 10-21-2009, 01:42 PM   #5
Esjjay
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Smile Figured it out

Well, with the help of a couple of friends here, I got it figured out. Seems that the PuTTY configuration had to have the last two ports configured for tunnelling (5903, 5904). I thought that I had already set that up but evidently didn't save the configuration. I decided to turn OFF the iptables service (everything is behind our firewall) and forego the need to have the PuTTY session running to make ANY tunnelled connection. I set up the vncserver configuration to omit the -localhost parameter like this (omitting the copious comment lines):

VNCSERVERS="1:larry 2:moe 3:curly 4:steve"
VNCSERVERARGS[1]="-geometry 1024x768 -AlwaysShared"
VNCSERVERARGS[2]="-geometry 1024x768 -AlwaysShared"
VNCSERVERARGS[3]="-geometry 1024x768 -AlwaysShared"
VNCSERVERARGS[4]="-geometry 1024x768 -AlwaysShared"

Now my netstats look like this:

netstat -an | grep 590
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5902 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5903 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5904 0.0.0.0:* LISTEN

So I am LISTENING for ANY connection to a given port. Now I can make the RealVNC or TightVNC and it still requires me to enter the user passwords. (I want at least that much protection.)
 
  


Reply

Tags
vncserver


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VNCServer - auto allow incoming connections? Jayla Linux - Software 7 03-22-2008 11:45 AM
VNCServer not accpeting connections ALInux Linux - Networking 3 07-25-2006 12:04 AM
vncserver file and normal user zillah Linux - Laptop and Netbook 5 05-31-2006 12:02 AM
vncserver for each user on boot devfreak Linux - Software 6 04-10-2005 06:42 PM
vncserver in rc.local as other user? jvdbossc Linux - General 2 05-24-2004 08:45 AM


All times are GMT -5. The time now is 10:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration