LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2008, 09:19 AM   #1
brooky9999
Member
 
Registered: May 2006
Location: Marlow, UK
Distribution: Slackware 12.2
Posts: 232

Rep: Reputation: 30
.Xauthority file problems on Slack 10.2


Hi,

I have somehow managed to delete root's .Xauthority file on my Slack 10.2 box.

Now if I become root and try to launch an application (for example to upgrade it) then I get the following:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

(firefox-bin:5117): Gtk-WARNING **: cannot open display:
I have copied one over from a normal user, but this doesn't work properly / only works for a short time.

I have tried to generate a new .Xauhority file but haven't had much luck. Any ideas?


M.
 
Old 02-08-2008, 09:28 AM   #2
brooky9999
Member
 
Registered: May 2006
Location: Marlow, UK
Distribution: Slackware 12.2
Posts: 232

Original Poster
Rep: Reputation: 30
I have tried generating a new .Xauthority file by doing:

Code:
xauth generate :0 .
which gives me:
xauth: creating new authority file /root/.Xauthority <------ this looks promising
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

xauth: (argv):1: unable to open display ":0". <------ not so promising
Does anyone know what I'm doing wrong?


M.
 
Old 02-08-2008, 12:41 PM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Usually you don't need to generate these files manually. Just start using 'startx'.
 
Old 02-08-2008, 12:45 PM   #4
brooky9999
Member
 
Registered: May 2006
Location: Marlow, UK
Distribution: Slackware 12.2
Posts: 232

Original Poster
Rep: Reputation: 30
I can log on as root, that's fine.

The issue is when I log on as a normal user, and then use 'su' in a terminal to become root.

Any thoughts?


M.
 
Old 02-08-2008, 01:54 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Do you mean that while running X as a normal user and trying to su to root inside a terminal emulator(xterm). Or are you trying to su to root from a real cli console? Are you trying to start an application directly before starting X?
 
Old 02-08-2008, 02:20 PM   #6
brooky9999
Member
 
Registered: May 2006
Location: Marlow, UK
Distribution: Slackware 12.2
Posts: 232

Original Poster
Rep: Reputation: 30
Yes - I am running X as a normal user.

Then I fire up an xterm, and run 'su'. The idea is that I become root, run the app I want, and then close it. I then kill the xterm session.



M.
 
Old 02-09-2008, 01:24 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You want to start the app as root and which of the below?
1. have it run on your user desktop
2. have it run on root's desktop
3. have it run on roots cli
 
Old 02-09-2008, 05:12 AM   #8
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
I think i understand what the OP is referring to.

They are trying to run a GUI app by su in the terminal from a user's x session. (For example, running thunar as root from user foo's gui xsession.)
Code:
foo@home:~:su
Password:
root@home:/home/foo#thunar
then the errors start.


What they are trying to do, in general, won't work. But if you try using 'sudo' instead of 'su', I think you will better success.

NOTE: I just tried the 'su' route on my box, but I've modified my sudoers file and many, many other things, that 'su' DOES work...It didn't before...

To modify your sudoers file safely(according to the common wisdom/knowledge/custom), use 'visudo' (I used a text editor with no ill effects so far, but...).

As for how to use visudo, search the forum, it has better instructions than I could even attempt to write here.
 
Old 02-09-2008, 06:31 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I suspect the same as you -that's why I am trying to pin dowm exactly what he wants. There is a small program (actually a script) which makes these things a little easier to do. It's called 'sux'. You can get a package of it here:
http://distro.ibiblio.org/pub/linux/...ils/sux-1.0.1/
 
Old 02-09-2008, 06:56 AM   #10
brooky9999
Member
 
Registered: May 2006
Location: Marlow, UK
Distribution: Slackware 12.2
Posts: 232

Original Poster
Rep: Reputation: 30
Hi guys,

Thanks for your answers.

I'm pretty well up on sudo, and after editing my sudoers file, it appears to solve my problems.

It's also easier this way too.

One point though - I could definitely run applications using the xterm / su route before hosing root's .Xauthority file. But that's irrelevant now.

Many thanks,


M.
 
Old 02-09-2008, 11:57 AM   #11
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Quote:
Originally Posted by brooky9999 View Post
...

One point though - I could definitely run applications using the xterm / su route before hosing root's .Xauthority file. But that's irrelevant now.

Many thanks,


M.
I believe that is the route that gnashley was referring to, a modification of the .Xauthority file.

In the kernel sticky here in the forum, there is also a way to have su apps displayed on the users gui. (It may be the same script. Been a long time since I remembered seeing it in that post...Lots of stuff to read in there...lol

But since mine also runs root apps thru the terminal using 'su', I'm assuming I DID run that script or something very similar at some point (one of the 'issues' of old age..."Did I already do that?")

But very glad to see you found a way. That's what I love about the Slackware community...If you ask three different people a question, you'll more than likely get 6 answers, and one of them ought to not only work, but that you'll feel comfortable using.
 
  


Reply



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
xauth: timeout in locking authority file ~/.Xauthority? otbibb Linux - Software 6 08-28-2013 01:42 PM
Xauthority file prblem incognito_kanchi Linux - Desktop 1 01-17-2007 11:56 PM
Xauthority file solution hardeep_ubhi Red Hat 0 10-03-2006 07:50 AM
.Xauthority problems when starting up a_priebe47 Slackware 6 03-22-2005 01:03 AM
xauth.... time out locking file .Xauthority DraaX Slackware 17 12-01-2004 12:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:47 AM.

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
Open Source Consulting | Domain Registration