Back Forum Reply New

Running Programs As Different User

Hi
Fairly newbie-ish user here.
I basically want to run a program under a different (and more privileged) user inside some other user's logged in session.

The program in question is mainly Ktorrent. Any other program would do too, but ktorrent is the main one that I'm interested in running through a different account.

Any ideas on how I can go about doing this?

you can switch to different user inside another user's logged in session using the 'su' command.in commandline just give
su lt;usernamegt;give the password if it asks and then run the program u want from there.this is the simplest idea i know for general linux....
im not sure as i have nt tried this in ubuntu .check if it worksif u want to become root and run the program just givesudo lt;programnamegt;
it will run the program as root.

Alt-F2
Code:
kdesu ktorrentIsn't it a bit dangerous running an internet program as root, though?

Thanks for the reply.

Hmmm, that doesn't seem to work out with ktorrent or even gaim for that matter.

For instance, when I do 'su lt;usernamegt;' and then run something like Gaim, I get the following message in terminal:Code:
Xlib: connection to quot;:0.0quot; refused by server
Xlib: No protocol specified(gaim:9321): Gdk-CRITICAL **: gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed
Gaim 2.0.0beta6

** (gaim:9321): WARNING **: cannot open display: unset
I think i have to run an X server or something to get it to run. I tried downloaded this app called Xnest that is apparently right for the job, but I'm not sure how to use it.

Do you have any specific reason to run that type of program as root?

Oh, the X server isn't running? Are you strictly at the command-line with no graphical user interface? I assumed, since you mentioned KTorrent, that you were using Kubuntu.


Originally Posted by zvacetDo you have any specific reason to run that type of program as root?

No. I just want to run it as any other user. I Wouldn't want to run it as root for sure. Not a safe thing to do even with my limited knowledge as a Linux user
Originally Posted by aysiuOh, the X server isn't running? Are you strictly at the command-line with no graphical user interface? I assumed, since you mentioned KTorrent, that you were using Kubuntu.

I'm on Feisty Fawn.

This is what I get when I type 'su lt;usernamegt;quot;, followed by 'kdesu ktorrent' Code:
Xlib: connection to quot;:0.0quot; refused by server
Xlib: No protocol specified

kdesu: cannot connect to X server :0.0
This is after installing 'kdebase-bin'

If you have su'd to another user, you do not need 'kdesu' as preface.  But still, you'll get a different error probably that's somewhat similar.  I think it relates to what groups your user belongs to.  If you can run ktorrent fine as your normal user, you should figure out which group allows you to run it.

^hmm. That might be the case, but I'm not sure how to resolve it. For instance, I can't even use 'ls' once i've done the 'su lt;usernamegt;quot; command

Here's how I have the accounts.
User1 (as part of group quot;adminquot;)
User2 (as part of group quot;usersquot;)

Once logged in as User1, and going to terminal to enter quot;su User2quot; followed by 'ls' reveales
quotermission Deniedquot;
Moreover, trying to run ktorrent reveals a string of errors... or more specifically the following:

Code:
Xlib: connection to quot;:0.0quot; refused by server
Xlib: No protocol specified

kdeinit: Can't connect to the X Server.
kdeinit: Might not terminate at end of session.
Xlib: connection to quot;:0.0quot; refused by server
Xlib: No protocol specified

kded: cannot connect to X server :0.0
kded: ERROR: KUniqueApplication: Registering failed!
kded: ERROR: Communication problem with kded, it probably crashed.
Xlib: connection to quot;:0.0quot; refused by server
Xlib: No protocol specified

Qt: Warning: ktorrent: cannot connect to X server :0.0
ERROR: KUniqueApplication: Registering failed!
ERROR: Communication problem with ktorrent, it probably crashed.
Also, I'm not sure if this helps but when I first login through the main login screen (with the User1 account) I get this small message that says the following:
User's $Home/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions. User's $Home directory must be owned by user and not writable by other users.

It goes away when I hit 'OK'. I'm not sure if that helps, but here it is anyway.
¥
Back Forum Reply New