Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-08-2004, 01:25 PM   #1
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
setuid question, or how to run a program with different ID

There is a nice program on my PC - niceprogram.
While it runs smoothely with user ID 501 (userA), it doesn't run with user ID 502 (userB).

There is no problem when userA is logged into the machine. The problem is with the userB. The work around I found till now is to type into the terminal:
$ su userA
$ niceprogram

I wonder if there is way to combine all three steps into one step?

Maybe it has something to do with setuid?
Maybe, a little #bin/bash will do the job?

userB is not a root, the program is owned by the root, I guess, though it was installed by userA.

Any comment?
Old 07-08-2004, 01:33 PM   #2
Registered: Jan 2004
Posts: 53

Rep: Reputation: 15
To cut it to two steps:

su userA -c niceprogram

you still have to enter the password

To do it in one step, edit your /etc/sudoers file so you can do:

sudo niceprogram
Old 07-08-2004, 01:34 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Post the output of
ls -l
of the file and the directory it lives in?

Old 07-09-2004, 05:27 AM   #4
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Original Poster
Rep: Reputation: 30
ls -l

-rwxr-xr-x 1 root root 1145985 Jul 7 22:41 gjiten*

Here it is. The program is gjiten


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
setuid programs hang when run by non-root users in RH9 jbkrash Red Hat 0 09-21-2004 02:17 PM
Program to run mfo6463 Linux - Newbie 2 04-21-2004 08:28 PM
.xinitrc question. Just trying to get one program to run hindenbergbaby Linux - General 2 02-21-2004 07:06 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM
want to run my C program........ gurpreetpall Programming 4 03-22-2002 04:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration