LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-08-2004, 01:25 PM   #1
linuxfond
Member
 
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
password:
$ 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
Gnuru
Member
 
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
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 07-09-2004, 05:27 AM   #4
linuxfond
Member
 
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
 
  


Reply


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


All times are GMT -5. The time now is 09:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration