LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 02-13-2024, 07:46 AM   #1
z_haseeb
Member
 
Registered: Jun 2008
Posts: 137

Rep: Reputation: 1
SUDO permission to install RPM


is it possible that we can allow a non-root user to install a specific package. for example I only want to allow a sudo permission to a non-root user to install redis-7.2.4-1.el8.remi.x86_64.rpm
 
Old 02-13-2024, 07:53 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
yes, definitely, it is possible.
I would suggest you to write a script, which will do the job as root (contains the exact command[s] you want to allow) and give sudo right to execute this script.
see here: https://unix.stackexchange.com/quest...rtain-commands
or here: https://superuser.com/questions/7674...commands-linux
 
Old 02-13-2024, 08:52 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by z_haseeb View Post
is it possible that we can allow a non-root user to install a specific package. for example I only want to allow a sudo permission to a non-root user to install redis-7.2.4-1.el8.remi.x86_64.rpm
Yes; and since you've been using Linux for *FIFTEEN YEARS*, it's hard to understand why you can't have researched this for yourself, given the hundreds of sudo related threads on this very site. Along with many examples of command-restriction.

And if you re-read what you just posted and think about it, you'd see what you're asking is pointless. Because it is for ONE PACKAGE...what's going to happen if the package is updated??? The command won't run, since the filename is different, right??? If you trust a non-root user to perform admin functions you either need to trust them or DO NOT trust them. No in-between. Either give them sudo or not.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Differences between Su, Sudo Su, Sudo -s and Sudo -i LXer Syndicated Linux News 0 09-15-2022 07:47 PM
What's difference between sudo install and sudo dpkg -i? linux-man Linux - Newbie 4 04-01-2022 09:21 AM
16.04 - Permission denied though I'm sudo and have permission to file insomniacno1 Ubuntu 5 10-22-2020 03:30 AM
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
.src.rpm, .i386.rpm and .i686.rpm hhegab Linux - Software 2 06-19-2003 07:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:10 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