- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Creating a sudo user in RHAS 2.1
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
07-16-2007 03:37 AM
07-16-2007 03:37 AM
I would like to know how to setup a user with sudo account. I would like to give this user the option to change the permission on a file from time to time.
I will try to do everything before giving up the root password.
Again, we're currently using RHAS 2.1.
Thank you in advance.
Jorge
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 03:48 AM
07-16-2007 03:48 AM
Re: Creating a sudo user in RHAS 2.1
username ALL = /bin/chmod /path/to/file NOPASSWD: ALL
This will allow the user to run chmod on the file as root. The NOPASSWD will not prompt the user for the users password. If you omit that the user will be prompted for the users password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 04:21 AM
07-16-2007 04:21 AM
Solutionusername ALL = /bin/chmod /path/to/file NOPASSWD: ALL
You will be giving the possibility to user "username" to run ALL commands as root. The format of the file is:
USER HOSTS = [(RUN_AS_USER)] [NOPASSWD:] LIST_OF_COMMANDS
For example, using visudo add:
user01 ALL = NOPASSWD: /bin/chmod /path/to/file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 04:35 AM
07-16-2007 04:35 AM
Re: Creating a sudo user in RHAS 2.1
You are correct. i still get confused with the order in the sudoers file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 06:23 AM
07-16-2007 06:23 AM
Re: Creating a sudo user in RHAS 2.1
Thank you everyone.
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 06:32 AM
07-16-2007 06:32 AM
Re: Creating a sudo user in RHAS 2.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 07:38 AM
07-16-2007 07:38 AM
Re: Creating a sudo user in RHAS 2.1
user01 ALL = NOPASSWD: /bin/chmod /path/to/file
Is there anything else I will need to do before I test out by logging as this user??
Thanks so much for your help.
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 07:42 AM
07-16-2007 07:42 AM
Re: Creating a sudo user in RHAS 2.1
user01 ALL = NOPASSWD: /bin/chmod /path/to/file
You need to pull the path to a real file.
Ej.
user01 ALL = NOPASSWD: /bin/chmod /data/eng/eng_group_file.out
Otherwise you are good to go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 07:43 AM
07-16-2007 07:43 AM
Re: Creating a sudo user in RHAS 2.1
user01 ALL = NOPASSWD: /bin/chmod /path/to/file
You need to put the path to a real file.
Ej.
user01 ALL = NOPASSWD: /bin/chmod /data/eng/eng_group_file.out
Otherwise you are good to go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 07:47 AM
07-16-2007 07:47 AM
Re: Creating a sudo user in RHAS 2.1
Any ideas?
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 09:22 AM
07-16-2007 09:22 AM
Re: Creating a sudo user in RHAS 2.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 10:11 AM
07-16-2007 10:11 AM
Re: Creating a sudo user in RHAS 2.1
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 12:00 PM
07-16-2007 12:00 PM
Re: Creating a sudo user in RHAS 2.1
# sudo chmod 755 /data/test.txt
the user will need to type the word sudo before the command and arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 04:30 PM
07-16-2007 04:30 PM
Re: Creating a sudo user in RHAS 2.1
Thanks so much.
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2007 03:40 AM
07-17-2007 03:40 AM
Re: Creating a sudo user in RHAS 2.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 04:02 AM
07-18-2007 04:02 AM
Re: Creating a sudo user in RHAS 2.1
Anyways, this is an error message that I received, "We trust you have received the usual lecture from the local system administrator. It usually boils down to these two things:
1. Respect the privacy of others.
2. Think before you type.
Password:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 04:03 AM
07-18-2007 04:03 AM
Re: Creating a sudo user in RHAS 2.1
Anyways, this is an error message that I received, "We trust you have received the usual lecture from the local system administrator. It usually boils down to these two things:
1. Respect the privacy of others.
2. Think before you type.
Password: "
I assume it's asking for the root password.
Please advise.
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 08:39 AM
07-18-2007 08:39 AM
Re: Creating a sudo user in RHAS 2.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 08:51 AM
07-18-2007 08:51 AM
Re: Creating a sudo user in RHAS 2.1
try this way.it should work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 11:15 AM
07-18-2007 11:15 AM
Re: Creating a sudo user in RHAS 2.1
Thanks,
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 12:30 PM
07-18-2007 12:30 PM
Re: Creating a sudo user in RHAS 2.1
I finally tested this on my laptop. Your entry should look like so
user1 ALL = NOPASSWD: /bin/chmod * /tmp/testfile
You need the asterisk as a placeholder for the mode, ie, 0750.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 03:47 PM
07-18-2007 03:47 PM
Re: Creating a sudo user in RHAS 2.1
test1 ALL=(root) NOPASSWD: /xx/yy/zz.ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 03:58 PM
07-18-2007 03:58 PM
Re: Creating a sudo user in RHAS 2.1
Thank you very much!!
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 04:07 AM
07-23-2007 04:07 AM
Re: Creating a sudo user in RHAS 2.1
This will eliminate the password prompt.
Thanks everyone.
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 04:07 AM
07-23-2007 04:07 AM
Re: Creating a sudo user in RHAS 2.1
Thanks,
Jorge