LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-08-2006, 05:36 AM   #1
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Rep: Reputation: 15
TIghtvnc issue


All computers in discussion have slackware 10.2 installed on them.

here's the issue, i have tightvnc installed on them, now suppose i want to connect from comp1 to comp2, because somebody else is sitting on comp1, let us assume that "user1" is logged into a gnome-session on comp1, then i ssh to comp1 and login as "user2", now when I run the command "vncserver" i get a message

"vncserver: couldn't find "xauth" on your PATH."

even if i run the command as root, i get the same message, but if I now login as "user1" i can start vncserver, i hope u get my point, to run a vnc server i have to run the command as the same user that is being logged into GUI.

Even if i am physically present on comp1, and i am logged in as user2, i open a terminal and run "vncserver" it works fine, but if i open the terminal and "su user3" and then "vncserver" it wont work, how do i get this work.

Last edited by kniwor; 11-08-2006 at 05:37 AM.
 
Old 11-08-2006, 10:44 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
I haven't used VNC over linux to another linux box, as I am generally of the opinion that servers should never have full blown X running on them.

Since that is just a personal preference and not a law, I suggest first that you check out this webpage - http://www.vanemery.com/Linux/VNC/vnc-over-ssh.html
It is a little old, but the info it has should still be true. You'll need to have that xauth file created for each user you want to connect to, and I believe the way to do that is by signing in as that user through SSH and running the vncserver command with the parameters set from the example webpage above.

Running VNC on non-standard ports (like using 5964 instead of the default 5901) is probably much safer too. There are tons of script kiddies out there who don't know jack about machines, but can indeed crack into a default installation in no time. Of course the really dangerous ones are the guys who do know a thing or two!

So in any case, check out the link, and see if you can get the remote server to show you what you want.

Peace,
JimBass
 
Old 11-10-2006, 09:42 PM   #3
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Original Poster
Rep: Reputation: 15
sorry but that does not solve the problem, because when i am running the vncserver command i get the abovementioned message....
 
Old 11-10-2006, 10:16 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
I googled for that error message, and found the answer here on linuxquestions!

Check out http://www.linuxquestions.org/questi...hreadid=387681

The very end of that thread is the important part, which I'll quote here:
Quote:
what path is it asking for?
~/home/{user}/.vnc/*.*

Did you try first typing in vncserver and entering your password? Each users must initialize a server with a password before they can request a login. This is done only once per user. The server generates the xauth following this. Sounds as if this wasn't done.
So you should get that error when you first try to run vncserver as any user, then it should get created.

Here is another good bit of info about xauth, again from linuxquestions:

Quote:
After getting the error message above about xauth. I looked about for a bit and found that I needed to install xauth.

I did this by typing yum install xorg-x11-xauth

Once the install has been made, type vncserver and it should ask for the password.

Hope this helps any newbies like myself.
Peace,
JimBass
 
Old 11-11-2006, 06:59 PM   #5
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Original Poster
Rep: Reputation: 15
k, i still cant get a vncserver for a user not in GUI, i mean if u read my first post carefully, the same problem still persists....

I CAN start a vncserver for all users, but i have to be in a gnome or KDE or some other session, just a login from terminal wont do. i cant understand the reason for this
 
Old 11-11-2006, 08:58 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
Quote:
Originally Posted by kniwor
"vncserver: couldn't find "xauth" on your PATH."
I don't know about the rest of it, but you can stop this message by editing /etc/login.defs and having something like the following in it:
Code:
ENV_PATH        PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
At least, that worked on one of my boxes...
 
Old 11-12-2006, 10:58 AM   #7
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Original Poster
Rep: Reputation: 15
k i did that,

Code:
root@bhos02:/etc# cat login.defs | grep ENV_PATH
# Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
ENV_PATH        PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
root@bhos02:/etc#
no diff.... any other ideas.
 
Old 11-12-2006, 02:18 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
No diff? You mean you still get the "vncserver: couldn't find "xauth" on your PATH." message?

You could try starting VNC at bootup and initiating sessions for the users at that point. For example, on the one box I allow VNC, the following script (/etc/rc.d/rc.vncserver) gets run with the other startup scripts:
Code:
#!/bin/sh
#
# description: Starts and stops vncserver. \
#         used to provide remote X administration services.

unset VNCSERVERARGS
VNCSERVERS="1:steve 2:oracle"
VNCSERVERARGS[1]="-geometry 1280x960"
VNCSERVERARGS[2]="-geometry 1280x960"

start() {
  echo -n $"Starting VNC server: "
  ulimit -S -c 0 >/dev/null 2>&1

  if [ ! -d /tmp/.X11-unix ]
  then
    mkdir -m 1777 /tmp/.X11-unix || :
  fi
  for display in ${VNCSERVERS}
  do
    echo -n "${display} "
    unset BASH_ENV ENV
    DISP="${display%%:*}"
    export USER="${display##*:}"
    export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
    su - ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
  done
}

stop() {
  echo -n $"Shutting down VNC server: "
  for display in ${VNCSERVERS}
  do
    echo -n "${display} "
    unset BASH_ENV ENV
    export USER="${display##*:}"
    su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
  done
  echo "Done."
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart|reload)
    stop
    sleep 3
    start
    ;;
  condrestart)
    if [ -f /var/lock/subsys/vncserver ]; then
      stop
      sleep 3
      start
    fi
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart|condrestart}"
    exit 1
esac
 
  


Reply


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
TightVNC metallica1973 Linux - Networking 2 08-22-2006 11:37 AM
TightVNC help, please. The Bane Linux - Software 5 08-05-2004 10:15 PM
tightvnc+X tsitras Linux - Software 2 03-24-2004 05:23 PM
Tightvnc len Linux - Software 11 06-24-2003 05:31 PM
TightVNC jeffer Linux - Software 1 05-22-2003 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:29 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration