LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-22-2018, 11:10 AM   #1
oliveoyl
Member
 
Registered: Sep 2016
Posts: 42

Rep: Reputation: Disabled
Question suid root


Hello,

I get what suid is but wanted to understand what is happening in the example below. Does chrome-sandbox run as root?

-r-sr-xr-x 1 root root 14312 May 7 22:16 chrome-sandbox*

Also what is the difference between the above and this:

-rwsr-xr-x 1 root root 14312 May 7 22:16 chrome-sandbox*

Please help me understand.
 
Old 05-23-2018, 07:27 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
1) Yes, the setuid for "owner" which is "root" means this command runs as root. The execute for both group and other means anyone can run this program but when they do it will run as root due to the setuid bit.

2) When you look at permissions with ls -l you see:
First character (-) in both of yours which means it is a regular file. You would see "d" for directory, "l" for symbolic link", "c" for a character (raw) device, "b" for block device, "s" for socket, etc...

The next 3 characters describe the file owner's permissions.
The next 3 characters describe the file group's permissions.
The final 3 characters describe "other" (everybody else's) permissions.

-r-sr-xr-x = Regular file, read and execute (with suid) for owner, read and execute for group, read and execute for other.

-rwsr-xr-x = Same as above except the "w" tells it to allow owner to write as well as read and executed.

In reality root user overrides all permissions so it could "write" to above file either way. However, for non-root users the lack of "w" for owner would allow them to read and execute but not write. Sometimes you do that if you're giving a user an executable that you don't want them modifying (especially a script).

Type "man chmod" for more detail of file modes (permissions) and how to set them.
 
  


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
smbmnt must be installed suid root figadiablo Linux - Networking 29 08-09-2007 11:12 PM
How do you install Nautilus with suid root? Lokathor Debian 2 02-27-2006 11:50 PM
insecurity in suid-to-root prabhatsoni Linux - Security 5 11-13-2004 03:57 AM
Only root can do that! (but i made it SUID root ?) qwijibow Linux - General 4 07-07-2004 10:51 AM
how to set artswrapper suid root ? chokecherry Linux - General 3 11-27-2003 03:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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