- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scrip to set root "at job"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 01:22 AM
08-04-2005 01:22 AM
scrip to set root "at job"
I need to create a script to set an "at job" to root from any user who run the script. I set SUID as:
-rwsrwx--- 1 root users mostra
but the "at" command refer to the user queue and not to root one. Even if in the script I insert "at -l" it show just the user queue and not all "at jobs":
> cat mostra
#!/usr/bin/sh
/usr/bin/at -l
Thank you!
romano
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 01:50 AM
08-04-2005 01:50 AM
Re: scrip to set root "at job"
Put a job for oot in crontab that runs every 10 minutes or so . Looks in a directory and runs anything it finds there before removing it.
Then users just put the job in roots in box and root runs it.
1)Directory with write for all.
2)1 script run by cron
find directory > /tmp/todoscripts
cat /tmp/todoscripts|while read line
do
chmod 777 $line
echo $line|at now
sleep 30
done
cat /tmp/todoscripts|while read line
do
/bin/rm $line
done
Your scripts could just be at commands
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 02:04 AM
08-04-2005 02:04 AM
Re: scrip to set root "at job"
Unless I'm missing something, it seems to me that Steve's suggestion would be opening the system wide open to any malicious or even just careless user to do untold damage to the system, and then removes the evidence.
If what you're asking for is the same thing, I think you should look for a different way of doing this.
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 02:08 AM
08-04-2005 02:08 AM
Re: scrip to set root "at job"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 02:34 AM
08-04-2005 02:34 AM
Re: scrip to set root "at job"
at -l should list all jobs if not followed with a user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 02:49 AM
08-04-2005 02:49 AM
Re: scrip to set root "at job"
I quite agree the Steve's proposal, probably he matched what I'm looking to do.
My need Is has twice aspects:
1) There is a scrip1 run by each user enabled to set an "at job" in queue "g" for script2 with root privileges (this works).
2) script1 must check how many (total)script2 are in the queue "g" in order to avoid an overhead caused by too many script2. This does not work because each user can see only its jobs of queue "g" even if script1 has SUID of root (only root can see all the jobs of all users of a queue).
HTH
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 03:14 AM
08-04-2005 03:14 AM
Re: scrip to set root "at job"
example:
a user could copy any shell, set suid, chown it to root and have a root shell whenever they want. Of course they wouldnt need to do this because they can do anything as root anyway.
another example:
cd /dir
rm -rf *
lets say /dir doesn't exist because of a typo. Hope you have good backups.
those are just two examples.
My question would be why do so many of your users need to run things as root? there should be very little need for a user to run as root.
Its your system to maintain, but you certainly opening up the system to be exploited.
And well it would never pass a security audit from my standpoint.
If your users need to do specific things as root, you would be better off setting up sudo for the commands they need to use. At least then you can track who did what.