LinuxQuestions.org
Visit Jeremy's Blog.
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 12-02-2005, 01:02 PM   #1
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Question setuid


I've coded a script that I want only an unprivileged user (david) to be able to read, write, and execute. However I need the script to run as another unprivileged user (vmail). I've read the suid howto here on LQ, but was unable to work it out on my system. I'm sure this is simple, but have been unsuccessful in all combinations of chown and chmod that I've tried so far.
 
Old 12-02-2005, 01:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
chmod u+s filename

can't get much simpler than that
 
Old 12-02-2005, 01:12 PM   #3
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Original Poster
Rep: Reputation: Disabled
How can I tell who the script is set to run as?

Code:
david@int0x80:~/addmailuser$ ls -lh | grep -v total
-rwx------ 1 david david 1.2K 2005-12-02 13:51 addmailuser
david@int0x80:~/addmailuser$ chmod u+s addmailuser
david@int0x80:~/addmailuser$ ls -lh | grep -v total
-rws------ 1 david david 1.2K 2005-12-02 13:51 addmailuser

Last edited by int0x80; 12-02-2005 at 01:14 PM.
 
Old 12-02-2005, 02:33 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
well that's the whole point of suid.. why are you trying to use it if you don't fully understand how it works?? it runs as whoever owns the file, rather than who actually executes it.
 
  


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
How to setuid root abridge Linux - Newbie 4 04-06-2005 04:59 PM
Using setuid with apache dale_lix Linux - General 0 02-03-2004 11:38 AM
setuid Help devinWhalen Linux - General 2 12-03-2003 10:57 AM
setuid for cdparanoia? megaspaz Linux - Software 1 10-12-2003 09:32 AM
Setuid SirTurbo Linux - General 1 03-26-2003 07:57 PM

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

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