- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Executing command from script as root.
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-28-2000 07:50 PM
08-28-2000 07:50 PM
Executing command from script as root.
commands on NFS file systems. Apparently,
only root can do it correctly.
As a result I have written a script that is
executing the chown/chgrp commands using the
following syntax:
su root -c "/usr/bin/chown -R
Is there a way to have this script execute
the command without prompting for a password?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2000 09:42 PM
08-28-2000 09:42 PM
Re: Executing command from script as root.
Actually it's root and the owner of a file that can change the permissions on a file.
No, there is no way to do what you want without providing a password.
Apparently, you map the root user to root by using the 'root=....' option in your /etc/exports file. This is not so good from a security point of view. The default behaviour for NFS is to map the root user to user 65534.
Maybe you can describe exactly why you have to chmod/chgrp those files. Maybe there is a way to prevent you from having to do it.
Bye,
Rik.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2000 10:19 PM
08-28-2000 10:19 PM
Re: Executing command from script as root.
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1dbb119c3420d411b66300108302854d,00.html
But, your case doesn't seem to be ok. What file system are you importing? How the export line in /etc/exports looks like?
You can try to enable SUID bit (s permission) if you like and security is not a concern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 01:08 AM
08-29-2000 01:08 AM
Re: Executing command from script as root.
There are other alternatives but they are security breeches...
On which machine are you trying to chown?
On the importing NFS FS ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 05:22 AM
08-29-2000 05:22 AM
Re: Executing command from script as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 06:31 AM
08-29-2000 06:31 AM
Re: Executing command from script as root.
Sudo provides a number advantages. Auditing, containability, and flexibility are the main advantages to using sudo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 09:40 AM
08-29-2000 09:40 AM
Re: Executing command from script as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2000 08:02 AM
08-30-2000 08:02 AM
Re: Executing command from script as root.
loook at the included "chmodutils" file.
make changes you need,
put yourfile in /usr/sbin directory
chown root yourfile , chgrp sys yourfile
look at man 1m chmod command
probably your solution will be
chmod 4555 yourfile
(set-user-id on file execution)
I wich attached file is well attached, it's first time I do that
Tourlou ;-)
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2000 12:17 PM
08-30-2000 12:17 PM
Re: Executing command from script as root.
> exportfs /directory -root=client1,anon=0,rw=host1:host2:host3,ro=host4:host5
This restricts access to known hosts. You can also use an "access=netgroup" for read-write access.
If root is specified in the exports file, your problem is solved. While I use sudo for several tasks, I would not use sudo for this task. This gives that user(s) global access then to chmod, chown, chgrp anything. It is a root level task, which should really be done by root's cron on the server.
I have the same task running on one of my servers. The only other thing to mention of this is LOG LOG LOG. (should go without saying).
Best Regards,
Shannon