LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-22-2016, 09:45 AM   #1
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Rep: Reputation: 4
What is good security measure to give normal user some super user power


supposed two normal user share dir in same group. and if root wants to grant those two users power to change group id to group they're sharing, but don't want to give any other power, how can that be achieved?

I thinking place a setuid root shell script that changes group id to group id they're sharing without permission to change the content of the script.

I heard it's security risk. what other safe way to grant normal user to change group id of file and dir but prevents other power?

Last edited by babbab; 01-22-2016 at 09:47 AM.
 
Old 01-22-2016, 10:22 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You can also use "sudo".
 
Old 01-22-2016, 12:40 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
babbab, i think what you want can be achieved with linux file permissions and sudo.
you should read up on the subject of file permissions, and sudo's documentation.
maybe tldp.org can help.
 
Old 01-22-2016, 02:55 PM   #4
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Original Poster
Rep: Reputation: 4
No I mean I want to give super power to normal user but don't want to give super power to normal user.

I want normal user able to execute script of change group id of file on certain directory only without making any change to the script, so it's very specific power. But I don't want to give any other super power to normal user.

I was thinking setuid of script without write permission, but is it safe?

Last edited by babbab; 01-22-2016 at 02:58 PM.
 
Old 01-22-2016, 03:20 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Quote:
Originally Posted by babbab View Post
No I mean I want to give super power to normal user but don't want to give super power to normal user.
That makes no sense.

But to understand why setuid scripts is a very bad idea, see here.

Quote:
Originally Posted by babbab View Post
I was thinking setuid of script without write permission, but is it safe?
No.

And not only is it not safe, it is not possible on most distros without modifying the kernel.

Read about sudo and file permissions as already noted, to accomplish your end goal.
 
Old 01-22-2016, 04:26 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Allow A Normal User To Run Commands As root Under Linux / UNIX Operating Systems
 
Old 01-22-2016, 04:44 PM   #7
wagscat123
Member
 
Registered: Jan 2009
Location: Maryland-Pennsylvania border, USA
Distribution: openSUSE 15.2/15.3, Tumbleweed, Kubuntu 18.04/21.04, macOS 10.15, antiX 19, and Linux Mint 19.3
Posts: 860
Blog Entries: 45

Rep: Reputation: 120Reputation: 120
Do you mean running "chmod +x script.sh" to make a script run with "./script.sh"? You can just have a normal user run that on a shell script, and everything is cool if the script doesn't execute any root commands or edit files that the user can't edit.
 
Old 01-25-2016, 07:28 AM   #8
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Original Poster
Rep: Reputation: 4
Quote:


Originally Posted by babbab View Post

>>>No I mean I want to give super power to normal user but don't want to give super >>>power to normal user.

>>That makes no sense.

it makes sense, it's the language incapable of expressing such thing
 
Old 01-25-2016, 08:51 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by babbab View Post
No I mean I want to give super power to normal user but don't want to give super power to normal user.

I want normal user able to execute script of change group id of file on certain directory only without making any change to the script, so it's very specific power. But I don't want to give any other super power to normal user.

I was thinking setuid of script without write permission, but is it safe?
Grant either chmod, or chown, or other similar coreutils to the "normal user" using the link I gave you earlier
in the Example
Code:
jadmin ALL= NOPASSWD: /path/to/coreutil

Last edited by Habitual; 01-25-2016 at 09:18 AM.
 
  


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
Give permission to execute process as super user... chamila1986 Linux - Newbie 2 07-27-2010 06:03 AM
How to make a normal user execute commands of the super user's .?.. siranjeevi Linux - Server 1 07-03-2010 03:51 AM
super user privileges check for a normal user in bash script freeindy Programming 2 08-01-2008 06:08 AM
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:14 PM.

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