LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-09-2021, 07:32 AM   #1
Danielb630
LQ Newbie
 
Registered: Mar 2021
Posts: 3

Rep: Reputation: Disabled
user privilege specification


hey all,
i am using centos 7.9 and I'm trying to give a specific user the permission to run a specific bash script as root under his home directory,
i tried to add this
Quote:
kobol ALL=(ALL) NOPASSWD: /home/kobol/test1.sh
to /etc/sudoers.d with no success
 
Old 04-09-2021, 07:38 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
It should be something like this:

Code:
%kobol ALL=(root:root) NOPASSWD: /usr/local/bin/test1.sh ""
Where the script /usr/local/bin/test1.sh is readable and executable by kobol but not writable. The reason for that is to prevent the account kobol from writing their own passport to the system by permanently or temporarily modifying the script and running it with elevated privileges.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Privilege Escalation - Getting 'root' privilege Rahil Parikh Linux - Security 2 12-02-2010 01:04 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM
Changing User Privilege question johnnygnote Linux - Software 6 11-13-2003 04:32 PM
Ulimit privilege for a user linuxfans Linux - General 3 04-16-2003 12:03 PM
User privilege on NFS directory Rex_chaos Linux - Networking 2 03-22-2002 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration