user1731553
user1731553

Reputation: 1937

shell script to set the suid bit as root user

I need a Shell script, this shell script should : 1. create another shell script 2. set the suid bit for new script as a root user 3. run this new script as current user

Can we do this? anyone can give any idea or some code snippets?

Upvotes: 0

Views: 635

Answers (1)

Ben
Ben

Reputation: 693

This will not work under many versions of unix (or linux). The setuid bit on shell scripts is typically ignored, since it is far too easy to subvert such a program.

Upvotes: 1

Related Questions