Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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
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? 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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.