LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-17-2005, 09:04 PM   #16
nazdrowie
Member
 
Registered: Oct 2004
Distribution: Debian
Posts: 39

Original Poster
Rep: Reputation: 15

abisko00,
I'm connecting to X locally, so I guess your comments don't apply. I think I'll just stick with kdesu, like reddazz suggested, at least till I get motivated and skilled enough to check out the source code for kdesu to see what makes it tick.

reddazz,
I never use double quotes when running 'su -c', and I never have any problems (unless root and X are concerned, but that's a different story altogether), so I have no idea what you're talking about (my guess is that double quotes are necessary only if the command contains spaces, as in the following, ' su -c "cmd -a -b -c" ').
I've already tried '$xhost +localhost' without any success. And I know that if I need a GUI, then that's up to ME. That's why I started the thread: to solve MY problem. And why the fixation with nmap? Forget about nmap; what if I were to tell you that there exists an application that requires root and is significantly more usable in GUI (or maybe even non-existant in command mode)? Besides, I just want to learn how to configure my system; supposedly, it's one of Linux's strengths :S
 
Old 02-17-2005, 10:31 PM   #17
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Try running xhost +, then run your app using su or su -c. This will unfortunately accept connections from any host, but it may help your situation. Does your PC have another hostname coz instead of using localhost, try using the host name you gave the pc e.g. xhost +hostname as the user who started the xserver. As for su -c, it works fine without the quotes, but it depends on exactly what you are trying to do, the quotes maybe necessary, so it's out of habit that most people use it with the double quotes. I wasn't getting fixated on "nmap", it's the example you gave, so most people thought it's the application you were attempting to run.

As for running GUI apps as root, nobody said that you couldn't or shouldn't do it, but people are giving you their points of view on the pros and cons of doing this. There are some GUI apps that run as root, mostly configuration utilities such as Mandrake Control Centre, Synaptic etc, but you don't need to use these very often. If you also run GUI desktops such as KDE and GNOME as root, you will be also inviting trouble because anything you do, affects the whole system and if anyone hacked into your system, they would have full root privileges and can wreak havoc on your PC. So by all means go ahead and use a GUI tool if thats what you are comfortable with, but just make sure you are up to scratch with security issues etc.
 
Old 03-07-2005, 09:01 PM   #18
AWK
LQ Newbie
 
Registered: Mar 2005
Location: MA
Distribution: Mepis Debian GNU/Linux
Posts: 11

Rep: Reputation: 0
'xhost local:' solved this for me.
 
Old 05-12-2005, 07:30 AM   #19
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Hi folks,

Fedora Core 3
On KDE desktop

I got an opposite problem searching around for solution.

I can't run GUI program on network as USER, e.g.
KStart -> System Settings -> Nework

KStart -> Internet -> KPPP
etc.

They were starting but closed finally

As "root" no problem at all.

I tried adding a new USER. Same problem occured.

Any advice. TIA

satimis
 
Old 05-12-2005, 10:44 AM   #20
AWK
LQ Newbie
 
Registered: Mar 2005
Location: MA
Distribution: Mepis Debian GNU/Linux
Posts: 11

Rep: Reputation: 0
can't run GUI program on network as USER

Try running from a terminal, eg. open konsole and type kppp. Look at the terminal output, post. Perhaps the two Redhat topics in this faq might be helpful: http://ktown.kde.org/~kppp/faq.html.

Last edited by AWK; 05-12-2005 at 10:47 AM.
 
Old 05-12-2005, 11:06 AM   #21
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Re: can't run GUI program on network as USER

Hi AWK,

Tks for your advice and link.

Quote:
Try running from a terminal, eg. open konsole and type kppp....
Have tried before. as USER KPPP could not be started

$ kppp
$ system-config-network
$ /usr/bin/system-config-network
$ hwbrowser
$ /usr/bin/yumex
$ yumex
etc.
All no printout.

As "root"
all of them can work.

B.R.
satimis
 
Old 05-12-2005, 09:11 PM   #22
AWK
LQ Newbie
 
Registered: Mar 2005
Location: MA
Distribution: Mepis Debian GNU/Linux
Posts: 11

Rep: Reputation: 0
Not sure, but you could try looking at the security settings (owner, group, permissions) on the affected program files and related files with 'ls -l', to see if your user has the appropriate permissions. This is what I get for kppp on my system (Mepis 3.3, not FC3), for example:
$ls -l /usr/bin/kppp
-rwsr-xr-- 1 root dip 575192 2005-01-26 09:03 /usr/bin/kppp

Last edited by AWK; 05-12-2005 at 09:14 PM.
 
Old 06-30-2005, 03:10 PM   #23
mathiasb
LQ Newbie
 
Registered: Jun 2005
Posts: 1

Rep: Reputation: 0
nazdrowie, if you're still looking for an answer to your original question about running things as root, you could try to look into this little script called sux (really nice name, btw.... you try to google for that....):

http://fgouget.free.fr/sux/sux-readme.shtml

it's a small sh-script that should do what you want
 
Old 11-30-2008, 08:01 PM   #24
kaziem
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 1
Quote:
Originally Posted by mathiasb View Post
nazdrowie, if you're still looking for an answer to your original question about running things as root, you could try to look into this little script called sux (really nice name, btw.... you try to google for that....):

http://fgouget.free.fr/sux/sux-readme.shtml

it's a small sh-script that should do what you want
I agree with everything nazdrowie said, I had the same problem with the same program and other GUI front ends. And I tried sux and works like a charm, thanks a lot mathiasb. It looks like all sux does is something with xauth.

Edit: I just realized this thread is like 3 years old lol
 
Old 12-01-2008, 12:27 AM   #25
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
Re: Can't run gui (X) programs as root user

Have you tried this:

As user:
Code:
export XAUTHORITY=/home/<user>/.Xauthority
export DISPLAY=:0
su
then

Code:
#xterm / whatever
This works for me with Debian.

Regards,
Stefan
 
Old 12-02-2008, 01:24 AM   #26
kaziem
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 1
Quote:
Originally Posted by propofol View Post
Have you tried this:

As user:
Code:
export XAUTHORITY=/home/<user>/.Xauthority
export DISPLAY=:0
su
then

Code:
#xterm / whatever
This works for me with Debian.

Regards,
Stefan
That works for me as well, thanks. Although it won't work if you use su -, instead su.

Last edited by kaziem; 12-02-2008 at 01:30 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run GUI program as root shadkong Slackware 8 09-20-2005 02:24 PM
GUI based SFTP programs that run in linux? Lleb_KCir Linux - Software 20 08-25-2004 04:02 PM
Can't run gui applications as root vdogvictor Linux - General 26 08-19-2004 08:24 PM
programs won't run on user (non-root) accounts....? once here Slackware 16 12-02-2003 08:44 AM
can't run X programs as root under suse 8.2 Moses420ca Linux - Newbie 1 09-05-2003 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:03 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