LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-11-2009, 02:40 AM   #1
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Rep: Reputation: 15
Running GUI apps as another user


Hi everyone. I'm trying to allow another user to remotely run programs which require a graphical interface as me. Ideally, I'd like the other user to be able to issue a simple command like

gksudo -u userA command

without entering a password, but I can't quite figure it out. After adding the user to the sudoers file, the above command works well, but returns errors about being unable to open the display. And

sux userA command

works, but requires the other user to entire userA's password every time.

How can I have another user run X programs as me?

Thanks!
 
Old 10-11-2009, 07:41 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
You need to set up X authentication so that the program can connect to your X windows server.

This could be as simple as using the -X option to ssh to make the remote connection. Or you might get it to work with "sudo sux userA command" (the sudo to disable the password, then run sux as root to forward X credentials for you).

See http://www.faqs.org/docs/Linux-mini/Remote-X-Apps.html

Hope that helps,

—Robert J Lee
 
Old 10-11-2009, 01:26 PM   #3
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
works...sort of

Adding sux to sudoers and using

sudo sux userA command

works great, but I'm concerned that it's a security risk. It lets the user run any command as userA, not just the intended command. Is there another option that lets me restrict what the user can run as userA?

Thanks
 
Old 10-11-2009, 04:01 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
You can configure sudo to allow users to only run certain commands without a password:

http://www.gratisoft.us/sudo/man/sudoers.html#wildcards

You can use a Runas_Spec to limit the users that they can run the command as, and use wildcards to limit the commands the user can run (remember to let the user run the command with and without sux)

Another option is to create a script to run the command as your user, and run "chmod a+rsx" on the script. It will then run suid, i.e. with the user ID of the owner of the file - but that's less good than sudo as then you can't limit who can use the file (at least, not without doing obscure things with directory ownership/permissions).
 
Old 10-26-2009, 06:02 PM   #5
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
thanks!

Everything's working great. Thanks
 
  


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
DISPLAY var troubles running GUI apps remotely JohnE1 Solaris / OpenSolaris 9 09-21-2007 07:37 PM
Config GUI Startup Apps for Users w/out Logging as the User jpdedmon Linux - Desktop 3 12-05-2006 06:06 PM
Running GUI apps frm terminal while logged in as normal user muttley Debian 3 08-07-2004 11:39 PM
Running root apps in X using regular user? nny0000 Slackware 10 01-15-2004 12:23 PM
Running apps under another user Vlackmar Linux - General 1 03-06-2002 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:09 PM.

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