Re: Sticky bit to allow access permission?



On 22 Jun 2006, in the Usenet newsgroup comp.os.linux.setup, in article
<1150982317.699003.264750@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
richardrothwell@xxxxxxxxx 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
.



Relevant Pages

  • Re: Trying my hand at scripting, easy task?
    ... Announcing the version 3.7 release of the "Advanced Bash Scripting Guide." ... This e-book tutorial and reference is the equivalent of a 672-page print book ...
    (comp.os.linux.misc)
  • Advanced Bash Scripting Guide, version 2.3 update
    ... Announcing the version 2.3 release of the "Advanced Bash Scripting Guide." ... This e-book tutorial and reference is the equivalent of a 600-page print book. ... License: Open Publication License ...
    (comp.os.linux.announce)
  • Advanced Bash Scripting Guide: Version 2.4. Update
    ... Announcing the version 2.4 release of the "Advanced Bash Scripting Guide." ... This e-book tutorial and reference is the equivalent of a 532-page print book. ... License: Open Publication License ...
    (comp.os.linux.announce)
  • Advanced Bash Scripting Guide: version 2.5 update
    ... Announcing the version 2.5 release of the "Advanced Bash Scripting Guide." ... This e-book tutorial and reference is the equivalent of a 542-page print book. ... License: Open Publication License ...
    (comp.os.linux.announce)
  • Advanced Bash Scripting Guide: version 2.6 update
    ... Announcing the version 2.6 release of the "Advanced Bash Scripting Guide." ... This e-book tutorial and reference is the equivalent of a 548-page print book. ... License: Open Publication License ...
    (comp.os.linux.announce)