Even with SUID other users cannot run script

Would like a user to run a script that changes a file permission for her.
This are the file permissions
-rwsrwsr-t file.sh
But any other user apart from script owner cannot run the script this is the error
chmod: file.sh  Operation not permitted.
This is the script
#!/usr/bin/sh
 find *ttt -perm 640 -print  -exec chmod 644 {} \;

Your assistance  is appreciated

Mike
mngong_rcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TintinCommented:
Just about all Unix/Linux kernels prevent you using setuid shell scripts because of the security risks.

The best way to handle this is to use sudo.

If you don't already have sudo, you can download it from http://www-03.ibm.com/systems/p/os/aix/linux/toolbox/date.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mngong_rcAuthor Commented:
Just so there is  no ambiguity.
User A owns the files .I want user B to run a  script.
to change the permissions on the files so that she can read the files  .
Are you suggesting user B sudo to user A? If that were the case there would be no issue
with user B changing the permissions if there were capable of  sudo ing  to user A
Ideally this needs to be done with  minimal changes and  a cron  job that changes the file
permissions every half hour or so appeared to be one optoin .The idea of SUID seemed to be the least intrusive though it is starting to look less feasible
Could be missing something

Thanks

Mike
0
gheistCommented:
sh is always under /bin/ as per POSIX and LSB requirements.

Do you need sudo usaage examples besides those in sudoers files.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mngong_rcAuthor Commented:
If sudo is the only way to do it Yes.
0
omarfaridCommented:
please see link below for sudo:

http://www.gratisoft.us/sudo/man/sudoers.html
0
gheistCommented:
sudo allows to restrict what commands can be executed as different user. one can use su, but then password for target user or root is necessary, so I'd back opinion that sudo is only reasonable option.

Part around "dgb" shows example that fits your needs.
You change chmod in your script to sudo -u target chmod and it works...
0
mngong_rcAuthor Commented:
Will accept the solution that there is no solution except with sudo .
Since you do not want any user sudoing to a priviledged user for the
purpose of running a script .You do not also want to make new entries
to /etc/sudoers only to let  users  execute a single
script for that reason a  cron job will be scheduled ever so often
to do the job.
Thanks to everyone for your input

Mike
0
TintinCommented:
You asked a question if something was possible, the experts here have told you it wasn't and gave you an alternative of sudo (which you don't want), but that is still an answer.
0
gheistCommented:
Thats actually complete "solution" since all other options do not fit in cron scenario...
0
mngong_rcAuthor Commented:
Please read the last post

>>Will accept the solution that there is no solution except with sudo >>

Thanks

0
TintinCommented:
Recommend #3

split between 22955739 & 22963885
0
omarfaridCommented:
Recommends #3
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Hardware

From novice to tech pro — start learning today.