Re: [SLUG] rights of root from su

2004-03-12 Thread Geoffrey Cowling


 
 which did you use?
 su or su -
 
 su will give you root priviliges with your path
 su - will give you root with root's paths.
 
 
 
 
Thank you very much.. this is now clear.

I sort of relised that su did not change environment variables...but 
thought that if user had access to X --or modem-- root ought to as well.
I did not understand the man page :-(

Geoffrey

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-12 Thread Geoffrey Cowling
 Because of X authorisation (xauth).
 
 If you are the only using this box, do a 
 'xhost localhost' before su'ing.  This will
 allow anyone on the local machine to connect.


Yes, only I am only user, so this will be fine, but
thank you for other note. Now I know what to look 
I think I can do it ..

many thanks
Geoffrey

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-12 Thread Angus Lees
At Fri, 12 Mar 2004 14:35:31 +1100, mlh  wrote:
 On Fri, Mar 12, 2004 at 02:30:12PM +1100, Geoffrey Cowling wrote:
  Xlib: connection to :0.0 refused by server
  Xlib: Client is not authorized to connect to Server
  ./setup: cannot connect to X server :0
  so I have to logout as user and login as root on X11...
 
 Because of X authorisation (xauth).
 
 If you are the only using this box, do a 
 'xhost localhost' before su'ing.  This will
 allow anyone on the local machine to connect.

For the special case of root (since root can read everyone's files),
you're better off doing as others have suggested and setting
XAUTHORITY to the relevant user's .Xauthority file.  If your gaining
root process doesn't change $HOME (eg sudo without -H, su with -m or
-p), then it should find the right .Xauthority file ok anyway.

-- 
 - Gus

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] rights of root from su

2004-03-11 Thread Geoffrey Cowling

sorry for such an elementary Q... :-(

I thought you could do ANYTHING as root..

Debian Woody -- su to root to install e.g. OO.o, error message:

glibc version: 2.2.5
Xlib: connection to :0.0 refused by server
Xlib: Client is not authorized to connect to Server
./setup: cannot connect to X server :0

so I have to logout as user and login as root on X11...

why?

(or should I just install as user?)
Geoffrey

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-11 Thread kevin . saenz

which did you use?
su or su -

su will give you root priviliges with your path
su - will give you root with root's paths.




sorry for such an elementary Q... :-(

I thought you could do ANYTHING as root..

Debian Woody -- su to root to install e.g. OO.o, error message:

glibc version: 2.2.5
Xlib: connection to :0.0 refused by server
Xlib: Client is not authorized to connect to Server
.../setup: cannot connect to X server :0

so I have to logout as user and login as root on X11...

why?

(or should I just install as user?)
Geoffrey

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html





-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-11 Thread mlh
On Fri, Mar 12, 2004 at 02:30:12PM +1100, Geoffrey Cowling wrote:
 Xlib: connection to :0.0 refused by server
 Xlib: Client is not authorized to connect to Server
 ./setup: cannot connect to X server :0
 
 so I have to logout as user and login as root on X11...
 
 why?

Because of X authorisation (xauth).

If you are the only using this box, do a 
'xhost localhost' before su'ing.  This will
allow anyone on the local machine to connect.

If you're not the only one, well don't do this,
use xauth instead; export the xauth cookie 
from your account and import to root's xauth.
(let me know if you a detailed howto; or google
for it)

Or ... you might try ssh'ing to the same machine,
and login as root (if you can). This will end up
using the original accounts authorisation.

I believe there is a PAM module for X that you 
tell su to do option 1 above automgically, but
the details escape me at the mo.

Matt

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-11 Thread Peter Hardy
On Fri, Mar 12, 2004 at 02:30:12PM +1100, Geoffrey Cowling wrote:
 
 sorry for such an elementary Q... :-(
 
 I thought you could do ANYTHING as root..
 
 Debian Woody -- su to root to install e.g. OO.o, error message:
 
 glibc version: 2.2.5
 Xlib: connection to :0.0 refused by server
 Xlib: Client is not authorized to connect to Server
 ./setup: cannot connect to X server :0

X11 is a network protocol.  It's not affected by the user ID of the user
trying to connect, it just makes sure that user can present the right
credentials to be allowed access.  This is usually stored in .Xauthority
in your home directory.

So, after su'ing, run

# export XAUTHORITY=/path/to/homedir/.Xauthority

(where /path/to/homedir is, of course, the path to your regular user's
home directory, usually /home/username)

-- 
Pete
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] rights of root from su

2004-03-11 Thread Dave Airlie
 Xlib: connection to :0.0 refused by server
 Xlib: Client is not authorized to connect to Server
 ./setup: cannot connect to X server :0

 so I have to logout as user and login as root on X11...

 why?

this works on RH/Fedora but it is a bit of a nasty hack :-),

for Debian after su'ing do export XAUTHORITY=/home/yourhomedir/.Xauthority

and life should be okay...

Dave.
-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html