Unix Technical Forum

Sticky bit to allow access permission?

This is a discussion on Sticky bit to allow access permission? within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hi there, can someone tell me how the sticky bit can be used in a shell script to allow ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 06:06 PM
richardrothwell@gmail.com
 
Posts: n/a
Default Sticky bit to allow access permission?

Hi there, can someone tell me how the sticky bit can be used in a shell
script to allow a normal user to run a root command such as adding a
new user?

So far im working with a simple script:

echo "I dont like" $1
exec $1

I obviously need to alter the first line with something that will set
permissions but i dont know what to put. Please help!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 06:06 PM
Laurenz Albe
 
Posts: n/a
Default Re: Sticky bit to allow access permission?

richardrothwell@gmail.com <richardrothwell@gmail.com> wrote:
> Hi there, can someone tell me how the sticky bit can be used in a shell
> script to allow a normal user to run a root command such as adding a
> new user?


You cannot use the sticky bit for it, what you probably mean is the
setuid bit.

My advice is to forget that idea. It would make your system insecure, and
you do not seem to know enough about Linux to really know what you are
doing.

If you are really, really certain that you want a normal user execute a
root command, look at 'sudo', a utility that lets you do exactly that.

Yours,
Laurenz Albe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 06:07 PM
Moe Trin
 
Posts: n/a
Default Re: Sticky bit to allow access permission?

On 22 Jun 2006, in the Usenet newsgroup comp.os.linux.setup, in article
<1150982317.699003.264750@i40g2000cwc.googlegroups .com>,
richardrothwell@gmail.com wrote:

>Hi there, can someone tell me how the sticky bit can be used in a shell
>script to allow a normal user to run a root command such as adding a
>new user?


1. It's not the sticky bit (which shows up as a 't' or 'T' in the
execute permission for others), but the SUID bit (which shows up as an
's' or 'S' in the execute permission for the owner). See the 'chmod'
man page.

2. The kernel ignores SUID (and SGID) on shell scripts - it's a massive
security problem.

3. Use 'sudo' to run the 'adduser' or 'useradd' command. 'man sudo'

>So far im working with a simple script:
>
>echo "I dont like" $1
>exec $1


Well, that certainly won't do much. Perhaps you should start with the
Bash-Prog-Intro-HOWTO

-rw-rw-r-- 1 gferg ldp 31540 Jul 27 2000 Bash-Prog-Intro-HOWTO

and then wander over to the Linux Documentation Project at
http://tldp.org/guides.html and grab a copy of The Grendel's fabulous
"Advanced Bash Scripting Guide". From a recent post to comp.os.linux.announce

Announcing the version 3.9 release of the "Advanced Bash Scripting Guide."
This e-book tutorial and reference is the equivalent of a 700-page print book.
With 320 illustrative examples (including such goodies as an anti-spammer
script), the book covers virtually every aspect of scripting.

The web site has the document in a number of file formats. I'd recommend
the HTML tarball

Old guy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com