- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Addind users to sudoers
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-11-2008 04:27 AM
08-11-2008 04:27 AM
Will this allow then to run the script with root privileges or do I need to add
/usr/lbin/modprpw -x
Also I will need them to run commands to cancel print jobs
In the sudoers file allowing the Help Desk authorization to run this as root?
drt9986 ALL=(ALL) NOPASSWD: ALL
cjk1402 ALL=(OP) NOPASSWD: ALL
jhf1366 ALL=(OP) NOPASSWD: ALL
HelpDesk ALL=(OP) NOPASSWD: ALL
Thanks
CJ
Solved! Go to Solution.
- Tags:
- sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2008 04:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2008 04:44 AM
08-11-2008 04:44 AM
Re: Addind users to sudoers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2008 04:49 AM
08-11-2008 04:49 AM
Re: Addind users to sudoers
Court
If I understand you correctly, this will allow the Help Desk to logon as Help Desk and execute all commands that are on my Help Desk Screen, see below
HelpDesk ALL=(OP) NOPASSWD: ALL
SCREEN SELECTIONS
1. Display printer status / print jobs.
a. Enter lpstat -p to view all printers
b. Enter lpstat -o to view all print request
2. Cancel a print job.
3. Cancel ALL print jobs for a printer.
4. Unlockes and Resets User Passwords
NOTE: A number or a group of letters will show on the screen, write down and provide this information to the user
5. This will execute the TOP command to look at the high load average on the servers. Monitoring purposes
NOTE: Control C breaks the process and returns to the Main Menu
6. EXIT this program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2008 04:54 AM
08-11-2008 04:54 AM
Re: Addind users to sudoers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2008 06:16 AM
08-11-2008 06:16 AM
Re: Addind users to sudoers
Thanks. I have written the script so they can not break out of it. I will set it up and test it on the servers they need to access. Thanks again 10++++ for you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2008 03:49 AM
08-12-2008 03:49 AM
Re: Addind users to sudoers
I was testing my script and found that if I eneter root or oracle on the line for password change (see below) It can be changed. How would I enter this in the sudoers to exclude root and oracle?
4. Unlockes and Resets User Passwords
NOTE: A number or a group of letters will show on the screen, write down and provide this information to the user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2008 03:53 AM
08-12-2008 03:53 AM
Re: Addind users to sudoers
add commands to exclude:
HelpDesk ALL=(OP) NOPASSWD: ALL, ! /usr/bin/passwd root, !/usr/bin/passwd oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:22 AM
08-18-2008 09:22 AM
Re: Addind users to sudoers
Helpdesk logon is set up and script is in place , when they logon and run the script is says ou must be supeuser, did I miss something when I added the line? Thanks
HelpDesk ALL=(OP) NOPASSWD: ALL, ! /usr/bin/passwd root, !/usr/bin/passwd oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:33 AM
08-18-2008 09:33 AM
Re: Addind users to sudoers
From: http://www.gratisoft.us/sudo/man/sudoers.html
It is generally not effective to ``subtract'' commands from ALL using the '!' operator. A user can trivially circumvent this by copying the desired command to a different name and then executing that. For example:
bill ALL = ALL, !SU, !SHELLS
Doesn't really prevent bill from running the commands listed in SU or SHELLS since he can simply copy those commands to a different name, or use a shell escape from an editor or other program. Therefore, these kind of restrictions should be considered advisory at best (and reinforced by policy).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:35 AM
08-18-2008 09:35 AM
Re: Addind users to sudoers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:44 AM
08-18-2008 09:44 AM
Re: Addind users to sudoers
Here is the command line and no it does not have the sudo
4) echo "Username to modify \c"; read USER
TESTUSER=`awk -v USER=${USER} -F: '$1~USER { print $1 }' /etc/passwd`
if test "${USER}" != "${TESTUSER}"
then
echo "${USER} is invalid!"
echo "Press [ENTER] to continue. \c"
read NOTHING
else
#This command looks at the account if it has a password liftime expired it will reset the account and enable it
/usr/lbin/modprpw -x ${USER}
sleep 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:52 AM
08-18-2008 09:52 AM
Re: Addind users to sudoers
The '/usr/lbin/modprpw' command requires you to be root to execute.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 09:55 AM
08-18-2008 09:55 AM
Re: Addind users to sudoers
CJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2008 05:36 AM
08-26-2008 05:36 AM
Re: Addind users to sudoers
echo "Username to modify \c"; read USER
TESTUSER=`awk -v USER=${USER} -F: '$1~USER { print $1 }' /etc/passwd`
if test "${USER}" != "${TESTUSER}"
then
echo "${USER} is invalid!"
echo "Press [ENTER] to continue. \c"
read NOTHING
else
#This command looks at the account if it has a password liftime expired it will reset the account and enable it
sudo /usr/lbin/modprpw -x ${USER}
sleep 10
SUDOERS
HelpDesk ALL=(OP) NOPASSWD: ALL, ! /usr/bin/passwd root, !/usr/bin/passwd oracle, !/usr/bin/passwd ags1643
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2008 08:39 AM
08-26-2008 08:39 AM
Re: Addind users to sudoers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2008 10:39 AM
08-26-2008 10:39 AM
Re: Addind users to sudoers
Then the sudoers file should fine?
Correct?
One other question, I want to trap the CTR C
In my script I have trap ' ' INT, however when I do a CTR C (and I am still testing my script)
When I select number 6 on my script see below, I am taken to a $(prompt) I am trying to avoid any breakouts in the script that would put me at a prompt Thank -CJ
6*|Qq|bye|Ee ) print "Quitting! See You Later, $(whoami)" ; exit ;;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2008 10:50 AM
08-26-2008 10:50 AM
Re: Addind users to sudoers
Trapping the control_C as you showed is fine, but this isn't going to prevent your script (upon) 'exit' from returning you to a shell prompt, *or* for that matter from a smart user using a piped 'more' to enter a shell.
You can either 'exec' your script from a login profile --- which means that your environment becomes your script and when you exit that, you are logged off;
OR:
You can replace the definition of the account's "shell" in '/etc/passwd' with the full patch of your script.
Either solution above, means that an 'exit' terminates your script AND the user's login session; AND that the user cannot enter a shell.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2008 11:04 AM
08-26-2008 11:04 AM
Re: Addind users to sudoers
Your thoughts on the sudoers file, last thread
Thanks
-CJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2008 06:19 AM
08-27-2008 06:19 AM
Re: Addind users to sudoers
The sudoers entry you pasted only tries to prevent the specific command "/usr/bin/passwd ags1643". The fragment of script you pasted is running /usr/lbin/modprpw, not /usr/bin/passwd.
I have changed the sudo file (see below)
However when I run my script I am still abe to change the password. Any suggestions?
Below is the script line.
HelpDesk ALL=(OP) NOPASSWD: ALL, ! /usr/bin/passwd root, !/usr/bin/passwd oracle, !/usr/bin/passwd ajh1809
Script line
sudo passwd ${USER}
Thanks
-CJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2008 08:51 AM
08-27-2008 08:51 AM
Re: Addind users to sudoers
You shouldn't rely on .profile or /etc/profile for security because you can often get a shell without reading them. If you're using ssh (which everybody should be by now) it's usually as simple as "ssh -t server /sbin/sh" - no .profile or /etc/profile because it's not a login shell.
You should have as many experienced admins as you can find review your final setup. I've heard claims about secure scripts and restricted accounts often enough, and they have rarely held up under further scrutiny.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2008 09:25 AM
08-27-2008 09:25 AM
Re: Addind users to sudoers
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2008 12:09 PM
08-29-2008 12:09 PM