GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: User permission for script execution
Operating System - HP-UX
1846622
Members
1707
Online
110256
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
10-30-2006 05:13 AM
10-30-2006 05:13 AM
User permission for script execution
I need to create a user who needs to execute a script (the script runs lpstat commands)this user should only be able to to only access and execute the script. I have the sudoers file. can i set it up there? how do i set this up?
Thanks
Thomas
Thanks
Thomas
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 05:27 AM
10-30-2006 05:27 AM
Re: User permission for script execution
For example :
user1 ALL = NOPASSWD : /path/script
regards,
ivan
user1 ALL = NOPASSWD : /path/script
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 05:41 AM
10-30-2006 05:41 AM
Re: User permission for script execution
Hi Thomas,
Add the following to ~user/.profile:
exec yourscript
exit
Once the script exits, the user will be logged off.
Alternatively, you could modify /etc/passwd to change the user's shell to yourscript. If you decide to go with this option, make sure /path/to/yourscript appears in /etc/shells.
PCS
Add the following to ~user/.profile:
exec yourscript
exit
Once the script exits, the user will be logged off.
Alternatively, you could modify /etc/passwd to change the user's shell to yourscript. If you decide to go with this option, make sure /path/to/yourscript appears in /etc/shells.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 05:56 AM
10-30-2006 05:56 AM
Re: User permission for script execution
Yes, sudo is what I use here for the
techs to run printer commands.
Here is my setup. I have only put for
Cmnd_Alias the script name and the cancel
command that is in the script so they
can purge queues as cancel -e that
is in the printer_maintenance script as
an example. You have to do a sudo at one
point before they can run the commands
without the sudo in a script.
sudo caches their password for a while
so it does not keep asking them for it.:
# Add users to group HELPDESK.
User_Alias HELPDESK=user1
# Add commands they can run with sudo.
Cmnd_Alias HELPDESK=/usr/local/bin/printer_maintenance, \
/usr/bin/cancel
# Add servers and command alias.
HELPDESK ALL=HELPDESK
techs to run printer commands.
Here is my setup. I have only put for
Cmnd_Alias the script name and the cancel
command that is in the script so they
can purge queues as cancel -e
is in the printer_maintenance script as
an example. You have to do a sudo at one
point before they can run the commands
without the sudo
sudo caches their password for a while
so it does not keep asking them for it.:
# Add users to group HELPDESK.
User_Alias HELPDESK=user1
# Add commands they can run with sudo.
Cmnd_Alias HELPDESK=/usr/local/bin/printer_maintenance, \
/usr/bin/cancel
# Add servers and command alias.
HELPDESK ALL=HELPDESK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP