You are not logged in.

#1 2007-08-22 22:38:14

Fork
Member
Registered: 2007-08-06
Posts: 53

Can't start GUI apps as Root.

If i am logged as root i can't start GUI apps like:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kate: cannot connect to X server :0.0

should i post xorg.conf?

Offline

#2 2007-08-22 23:19:15

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Can't start GUI apps as Root.

Try using kdesu as normal user:

$ kdesu kate

Last edited by Misfit138 (2007-08-22 23:19:59)

Offline

#3 2007-08-22 23:20:57

Fork
Member
Registered: 2007-08-06
Posts: 53

Re: Can't start GUI apps as Root.

That starts the aplication. But i wanted to fix the problem, not get around it. Is it possible?

Offline

#4 2007-08-22 23:31:07

Kknd
Member
From: Brazil, Santa Catarina
Registered: 2007-08-15
Posts: 100
Website

Re: Can't start GUI apps as Root.

Fork wrote:

That starts the aplication. But i wanted to fix the problem, not get around it. Is it possible?

It's not really a problem, but you can copy your .Xauthority to give the same rights.

Offline

#5 2007-08-22 23:47:28

Fork
Member
Registered: 2007-08-06
Posts: 53

Re: Can't start GUI apps as Root.

i did that but now (after reboot)

[root@forks-desktop tiago]# kate
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
kate: cannot connect to X server :0.0

to copy i did:

cp .Xauthority ~

Last edited by Fork (2007-08-22 23:48:48)

Offline

#6 2007-08-23 00:21:35

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Can't start GUI apps as Root.

Kknd wrote:
Fork wrote:

That starts the aplication. But i wanted to fix the problem, not get around it. Is it possible?

It's not really a problem, but you can copy your .Xauthority to give the same rights.

It is not a problem, and in fact, using kdesu is probably the safest way to do it. Starting apps as root in X is risky. smile

Offline

#7 2007-08-23 01:10:09

chilebiker
Member
From: Zurich, Switzerland
Registered: 2006-07-18
Posts: 161

Re: Can't start GUI apps as Root.

As user type:

xhost + localhost

... or whatever your hostname is (check /etc/rc.conf)


Don't panic!

Offline

#8 2007-08-23 01:23:30

Acid7711
Member
From: Chicago, IL
Registered: 2006-08-18
Posts: 300
Website

Re: Can't start GUI apps as Root.

nano /etc/profile


add in the line

export XAUTHORITY=/home/usersnamegoesinhere/.Xauthority

Works like a charm. I had this problem a long time ago, this solves it perfectly, no need to grant Xauthority anymore since that does it on login.  I have a post about it someplace.

Last edited by Acid7711 (2007-08-23 01:23:56)

Offline

#9 2007-08-23 12:26:02

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Can't start GUI apps as Root.

Nooooooooooooooooo! You mustn't! Get to da choppa! Too much powa!! tongue
Hehe. I use kdesu because for me, there's too much of a chance I will mess something up using point and click.

Offline

#10 2007-08-23 12:36:55

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: Can't start GUI apps as Root.

I did this another way is this wrong in my users bashrc I added

xhost local:root

Have I commited a sin?

Offline

#11 2007-08-23 13:28:52

Fork
Member
Registered: 2007-08-06
Posts: 53

Re: Can't start GUI apps as Root.

Thanks acid7711, working great. Life is wonderfull big_smile

I wanted this because sometimes i am preforming operations as root, and not be able to because of that annying messege was frustrating.

Last edited by Fork (2007-08-23 13:30:09)

Offline

#12 2007-08-23 13:50:30

retsaw
Member
From: London, UK
Registered: 2005-03-22
Posts: 132

Re: Can't start GUI apps as Root.

FeatherMonkey wrote:

I did this another way is this wrong in my users bashrc I added

xhost local:root

Have I commited a sin?

The part after the colon is ignored, so that command allows any user account to connect to your X server.  So long as you trust everyone who uses your machine not to take advantage of that, it's fine.

Offline

#13 2007-08-23 13:53:21

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: Can't start GUI apps as Root.

Thanks retsaw I kinda of stumbled across my solution, puts my mind to rest.

Offline

#14 2007-08-23 19:30:40

mac57
Member
From: St. Somewhere
Registered: 2006-01-06
Posts: 302
Website

Re: Can't start GUI apps as Root.

You could also just do

xhost +

That all by itself pretty much lets anyone else access your X server. Assuming you are behind a secure firewall (and with DSL, most of us are these days - most DSL routers has a firewall) this is a simple and effective solution. You can put this in your .xinitrc and all should be well. Just another choice. Linux is all about choices!


Cast off the Microsoft shackles Jan 2005

Offline

Board footer

Powered by FluxBB