Remote Viewing Problem.

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Remote Viewing Problem.

Postby bodker on Sun Mar 18, 2007 6:46 pm

Hello Everyone,

I've kinda backed myself into a corner here in my attempts to view my machine over the network.

I've tried vnc4server, TightVNC, various x11 forwarding configurations... All I've managed to do is open a bunch of ports and make my system unstable. I've decided to wipe everything and start from scratch.

Unfortunately, I've already started the reinstall so can't give specific errors. No big deal. I'm looking more to start a discussion concerning what the community feels the best remote desktop method is. (in general and for Mint specifically)

In the end I'd like to able to view my Mint desktop both over the LAN and the internet. Remote ssh is/was setup and was no problem. But I could never get X (ssh -x) to forward to another machine. The error was something along the lines of, "user not authorized to run the X server, aborting" or "Server already active for display 0" depending on the config.

I was able to get it to forward using XDMCP but I don't want to open anything that insecure to the wider internet.

VNC would connect but always tell me I was not authenticated, even after adding specific users.

What do you use? What's the most secure? I'd like to get to the point where I can do everything with plain ol' ssh and the command line but I'm not there yet. Still need that GUI crutch. :)

Thanks for any input!

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Linux Mint is funded by ads and donations.
 

Postby Run N Duck on Sun Mar 18, 2007 9:12 pm

OK, not even pretending to be any kind of remote viewing expert or anything, but.. I use the 'remote desktop' on my Mom's computer (as a matter of fact we did almost all the computer setup with it-except the cd install) and it works damn fine. It's in 'preferences', then 'remote desktop', then you just click the 'allow users' button and put in a wickedly tough password and connect from anywhere in the world or house. It's really simple, you say you were adding users to VNC.... huh? I assume you were installing your own, not using the built-in I'm talking about. As far as security goes, well... with just a password it's only slightly secure I guess. Has anyone here had any problems with it? I'd like to hear about it, as I would shut it completely off until needed if I thought there were a chance of hacking etc.
Run N Duck
Level 1
Level 1
 
Posts: 15
Joined: Fri Mar 09, 2007 8:32 pm

Postby clivesay on Sun Mar 18, 2007 10:17 pm

I've had a vnc server running on Mepis once, but I had a heck of a time with Ubuntu and gnome. I never did get the server part working so I could connect. I could get the server to work from a command line launch but could never get it to launch at boot time. Seems to be tons of ways that people post on how to do it but I haven't been able to get any of them to work.
clivesay
Level 1
Level 1
 
Posts: 28
Joined: Tue Dec 26, 2006 7:41 pm

Postby bodker on Sun Mar 18, 2007 10:38 pm

clivesay wrote:Seems to be tons of ways that people post on how to do it but I haven't been able to get any of them to work.


And that's the boat I'm in now.

Run N Duck,

Thanks for the suggestion. Remote Desktop is an option for LAN access but I'm looking for another solution. Remote Desktop limits passwd length to 8 characters and is only available after login. Maybe there's a way to have the daemon (if that's the right word?) start on boot but I'm sure there are more secure ways.

x over ssh seems the most secure but I havn't been able to find a tutorial that has worked.

Thanks to all!

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Postby scorp123 on Mon Mar 19, 2007 11:26 am

bodker wrote:x over ssh seems the most secure but I havn't been able to find a tutorial that has worked.


ssh -X remoteusername@remotecomputer
:D
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby bodker on Mon Mar 19, 2007 7:43 pm

scorp123 wrote:ssh -X remoteusername@remotecomputer :D



Oh My God! If a X as opposed to x was the root of all my problems I'm going to destroy something! :x

I'll try -X when I get home. Thanks! :D

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Postby bodker on Mon Mar 19, 2007 10:27 pm

Thanks for the idea scorp123. Unfortunately, this is the result.

the following is after connecting with ssh -X usrname@machineIP


Linux mint 2.6.17-11-generic #2 SMP Thu Feb 1 19:52:28 UTC 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Mon Mar 19 21:06:35 2007 from 192.168.0.50
/usr/bin/X11/xauth: error in locking authority file /home/bodker/.Xauthority
You have many friends and very few living enemies.
bodker@mint:~$ startx
xauth: creating new authority file /home/bodker/.serverauth.12563
xauth: error in locking authority file /home/bodker/.Xauthority
xauth: error in locking authority file /home/bodker/.Xauthority
xauth: error in locking authority file /home/bodker/.Xauthority
xauth: error in locking authority file /home/bodker/.Xauthority
X: user not authorized to run the X server, aborting.
xinit: Server error.
xauth: error in locking authority file /home/bodker/.Xauthority
Couldnt get a file descriptor referring to the console
bodker@mint:~$


This is what always happens when trying to connect via ssh (with X). I have found some tutorials but none have worked. They usually end up screwing up my X configuration and I have to restore from backup.



/usr/bin/X11/xauth: error in locking authority file/home/bodker/.Xauthority

This is from the error above. It made me think it must be a permissions issue so I ran,

sudo startx

resulting in:

bodker@mint:~$ sudo startx
Password:
xauth: creating new authority file /home/bodker/.serverauth.12739
xauth: error in locking authority file /home/bodker/.Xauthority
xauth: error in locking authority file /home/lbodker/.Xauthority
xauth: error in locking authority file /home/bodker/.Xauthority
xauth: error in locking authority file /home/bodker/.Xauthority

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.


xauth: error in locking authority file /home/bodker/.Xauthority
bodker@mint:~$



removing the /tmp/.X0-lock file is what really messed things up and resulted in my most recent reinstall.

any more ideas?

Thanks as always,

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Postby clivesay on Mon Mar 19, 2007 11:49 pm

I thought I read in a how to that you need to type 'gnome-session' for gnome as opposed to 'startx'.

Chris
clivesay
Level 1
Level 1
 
Posts: 28
Joined: Tue Dec 26, 2006 7:41 pm

Postby bodker on Tue Mar 20, 2007 1:35 am

/usr/bin/X11/xauth: /home/bodker/.Xauthority not writable, changes will be ignored

is still there on initial connection.

bodker@mint:~$ gnome-session
X11 connection rejected because of wrong authentication.
The application 'gnome-session' lost its connection to the display localhost:11.0;
most likely the X server was shut down or you killed/destroyed
the application.


dang.

What do I need to edit to gain authorization to run an x session over the network?

Does this work for everyone else? Am I one of the few that actually wants to do this?

if it matters, to gain ssh capabilities, I installed the openssh-server. Would that make a difference?

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Postby scorp123 on Tue Mar 20, 2007 4:22 am

bodker wrote:sudo startx

You're not supposed to do that !!!!!!!!!!!!!!!!! :D :D :D :D

Again, you login via SSH:
ssh -X remoteuser@remotesystem

Once you're logged into the remote system, you launch your programs:
xclock &
gedit &
konqueror &
opera &

(that "&" on the end makes sure that the program won't block the open terminal shell while it's running ... to see the difference just leave it away if you wish ....)

As for SSH's many many parameters:
Code: Select all
man ssh
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Re: Remote Viewing Problem.

Postby scorp123 on Tue Mar 20, 2007 4:28 am

bodker wrote: vnc4server, TightVNC

Let's pickup that topic too .... VNC is easy. So what's the problem? Can you please go into more details here?
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby scorp123 on Tue Mar 20, 2007 4:31 am

clivesay wrote:I never did get the server part working so I could connect.
Please be more specific. :wink: What were you trying, or what did you want to achieve?
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby bodker on Tue Mar 20, 2007 11:47 pm

scorp123 wrote:You're not supposed to do that!!!!!!!!!!!!!!!!! :D :D :D :D

Again, you login via SSH:ssh -X remoteuser@remotesystem


Aw dang! :oops:

when I connect via ssh -X username@machinename I still get the -


Linux mint 2.6.17-11-generic #2 SMP Thu Feb 1 19:52:28 UTC 2007 i686

The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
Last login: Mon Mar 19 21:06:35 2007 from 192.168.0.50
/usr/bin/X11/xauth: /home/bodker/.Xauthority not writable, changes will be ignored
You have many friends and very few living enemies.
bodker@mint:~$

Once connected I if I run -

bodker@mint:~$ gedit &
[1] 8025
bodker@mint:~$ X11 connection rejected because of wrong authentication.
The application 'gedit' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.

[1]+ Exit 1 gedit
bodker@mint:~$

:?: :?: :?:

As far as VNC goes, this is a clean install and I have not yet ventured down that road. If I remember correctly, my problems were authentication related. I wouldn't be able to quote errors.

Scorp123, thanks for taking the time to think about this with me.

/drew
bodker
Level 1
Level 1
 
Posts: 10
Joined: Sat Mar 10, 2007 1:39 am
Location: Chicago

Postby scorp123 on Wed Mar 21, 2007 3:25 am

Delete this file: /home/bodker/.Xauthority ... then try again.

As for VNC ... are you sure you installed the needed packages? Let's test that. Open a terminal ... and then type vnc and hit the TAB key (NOT Enter!) a few times until it shows multiple possible commands, e.g.:

Code: Select all
 vnc <and then hit the TAB key!>
vnc2swf          vnc_inetd_httpd  vncpasswd.arg    vncviewer
vncconnect       vncpasswd        vncserver


This would show that VNC is there. If that happens to be the case: type vncpasswd ... it will ask you to define a password. Do that please. Then let's start a server:

vncserver :1 -depth 16 -geometry 1280x1024

Don't bother about connecting to this one yet .... I just want VNC to write a few default files. When the terminal's prompt returns kill the server:

vncserver -kill :1


Now let's take a look at the start script it just wrote for us:

gedit .vnc/xstartup

Mine looks like this -- you are free to copy it:
Code: Select all
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid darkgrey
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &

wmaker &

# xfwm4 &
# hackedbox &
# openbox &
# blackbox &


So my VNC would start WindowMaker for me ... as you can see I have other options in place. Let's suppose I'd want "BlackBox" to run, I'd put a "#" in front of that "wmaker &" command and then remove the "#" in front of the "blackbox &" command. For GNOME I'd add "gnome-session &" ... for KDE I'd add "startkde &".

Once this file looks the way you want you can try again and start the server again ... you could also define a shortcut on your desktop or write a boot script so that this either happens with the click of a mouse or automagically upon system start. I personally prefer to start my VNC servers manually, e.g. I first login via SSH and then launch the server on the remote machine only if I seriously need them; then I logout and connect via VNC if needed (or I build a SSH tunnel ... but that's another topic).

BTW, you can define whatever wacky screen resolution you want for your virtual VNC desktop ... you're not forced to choose "real" resolutions such as "1024x768" or "1280x1024". A command such as:

vncserver :1 -depth 16 -geometry 1100x720

... is perfectly valid. Above command will give me a nice 1100x720 virtual remote desktop which fits nicely on my laptop screen (1280x800). Feel free to experiment.
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Linux Mint is funded by ads and donations.
 

Return to Other topics

Who is online

Users browsing this forum: folimifre, vvarlock and 4 guests