- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problem regarding creating a new policy for powerb...
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
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
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
02-07-2013 08:40 AM
02-07-2013 08:40 AM
Problem regarding creating a new policy for powerbroker
Hi All,
I'm trying to create a new policy for powerbroker, which allows users to run a script as root. But, I'm not able to do so. Please, help.
# cat /etc/pb.conf
##############################################################################
include "/etc/pb/diskusage.conf";
include "/etc/pb/catchall.conf";
print("Fell through PowerBroker configuration. Please notify Summit System Support.");
reject;
# cat /etc/pb/diskusage.conf
all_diskusage_auth={
"ashutosh",
"root"
};
if ( ( user !all_diskusage_auth ) && ( command == "diskusage" ) ) {
reject "You are not authorized to use diskusage.";
# OK, user is authorized to use diskusage. Test for ownership in no-diskusage
# is done in shell code.
} else if ( ( user in all_diskusage_auth ) && ( command == "diskusage" ) ) {
runuser = "root";
runcommand = "/opt/summit/util/pb/diskusage";
accept;
}
# cat /opt/summit/util/pb/diskusage
#!/usr/bin/sh
##########################################################################
# Get the disk usage for all directories in /develop/home and
# log the results to a logfile in /tmp. Change the ownership
# of the logfile to the user "mcook" and move the file to the
# "mcook" home directory.
##########################################################################
##########################################################################
# Set up internal script variables.
##########################################################################
DATE=`date +"%m%d%y"`
LOG=ulog.${DATE}
##########################################################################
# Clean up any old logfiles, if present.
##########################################################################
echo "super run" >>/tmp/superrun
if [ -e /tmp/${LOG} ] ; then
rm -f /tmp/${LOG}
fi
if [ -e ~mcook/${LOG} ] ; then
rm -f ~mcook/${LOG}
fi
##########################################################################
# Change dir. to /develop/home and record the dir. usage.
##########################################################################
cd /develop/home
du -k -s * > /tmp/${LOG} 2>&1
##########################################################################
# Make sure final ownership and permissions on the logfile
# are correct, and move the file to the "mcook" home dir.
##########################################################################
chmod 644 /tmp/${LOG}
chown mcook:develop /tmp/${LOG}
mv /tmp/${LOG} ~mcook
exit 0
$ pbsu2 diskusage
pbrun7.0.0-08[7056]: ERROR: The specified security file was not found.
Regards,
Ashutosh Singh