setuid and guid


 
Thread Tools Search this Thread
Operating Systems Solaris setuid and guid
# 1  
Old 05-12-2008
setuid and guid

Hi All,

Can someone give me some info about setuid or guid topic? Also about sticky bit.

Thanks in advance,
itik
# 2  
Old 05-12-2008
Setting the sticky bit on a file instructs the kernel to not swap it out when running, it's seldom used these days.

Setting the sticky bit on a directory, however, instructs the filesystem to only allow a file to be deleted by it's owner, regardless off the write permissions the directory has set. This enables one to allow world write on a directory without allowing one user to interact with another user's files beyond the individual file's permissions. It's great for any directory where multiple users need to create files but you don't want one to delete another's.

A file that is setuid will, if executed, run with the permissions and id of the owner of the file (not necessarily the user logged in). This allows multiple users to share data or to escalate (or downgrade) rights.
It should be used with caution however as any bugs in the script or binary could be exploited to perform unintended tasks as the file owner. Anything forked off by the running executable will also inherit it's parent's rights so be careful of complex apps like vi, emacs etc that can start independant shells.

Setuid on a directory would normally cause any files created within that directory to be owned by the directory owner but this is disabled by default in solaris.

Setgid on a file does nothing on solaris as far as I know.

Setgid on a directory causes any files created to have their primary group set the the same group as the parent directory. It generally (depending on config and solaris revision) also sets the setgid bit on any subdirectories created.
# 3  
Old 05-12-2008
# 4  
Old 05-12-2008
Ok so what is now used instead of sticky bit?

Thanks and more power,
itik
# 5  
Old 05-12-2008
Hi
I also have same type of issue . I am trying to set owners uid in AIX using chmod 4754 but it does not work . It seems that AIX just ignores set uid thing .
The owner and a user in the group which executes the scripts need to be different . I do not want other user or even users in the group to read certain files (password files etc) .They are used to connect to oracle.
Other reason is that the scripts write to lots of directories on which these other users do not have privileges.
What is the alternate solution. There are 100s of scripts which can not be altered .
Regards
Clifford.
# 6  
Old 05-12-2008
I'd suggest moving the AIX setuid question over to the AIX section - I'm really only familiar with the Solaris use of it.

itik: I don't think I really understand your question... The sticky bit is still used plenty, it's just rare to use it on a file to hold it in memory - modern schedulers do a better job.

RBAC and sudo are also used as alternatives to setuid.
# 7  
Old 05-12-2008
Part 3 of https://www.unix.com/tips-tutorials/3...r-bin-ksh.html discusses suid shell scripts at some length. But a quick management summary: suid and sgid bits are ignored on shell scripts by many kernels. Solaris is an exception to this rule.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

What keeps me from abusing setuid(0) and programs with setuid bit set?

Just learning about the privilege escalation method provided by setuid. Correct me if I am wrong but what it does is change the uid of the current process to whatever uid I set. Right ? So what stops me from writing my own C program and calling setuid(0) within it and gaining root privileges ? ... (2 Replies)
Discussion started by: sreyan32
2 Replies

2. UNIX for Dummies Questions & Answers

tar file help and uid guid?

when I executed tar xvf jre-7u7-soloris-i586.tar.gz it created the last entry with user as 10 and group as 143. When I execute the cd to the jrel directory I get directory not found error. Not sure why this is happening. I am in the root account just trying to install Java Enterprise. ... (2 Replies)
Discussion started by: Fingerz
2 Replies

3. UNIX for Dummies Questions & Answers

Difference between normal Execute permission and GUID

Hi, Any can explain the difference between the normal execute permission for the file and GUID of the file. Since the normal execute permission has right to execute file why there is need of providing GUID for the same file. Also share some examples for SUID and SGID programs. Regards... (3 Replies)
Discussion started by: ksgnathan
3 Replies

4. Shell Programming and Scripting

Need some help extracting a GUID from file

I'm fairly new to scripting, and need some help in extracting a piece of data from some output I have. This is what the original output looks like: .--------------------------------------------------------------------------------------. | GUID | C1 | C2 ... (3 Replies)
Discussion started by: Akilleez
3 Replies

5. AIX

LEARNING AIX - PLS GUID MY BRO 'S & SISTERS !

Hi, I am harsath , am new to UNIX- Aix ust started to learning , interested in working with servers , is it necessary to know shell scripting before learning aix, will i get job only if i know aix .... pls reply..... Thanks in advance.... (2 Replies)
Discussion started by: harsath24330
2 Replies

6. UNIX for Dummies Questions & Answers

what is SUID,GUID and Sticky bit?

Dear all, what is SUID,GUID and Sticky bit permission? can anyone gave me explanation with example? thanks in advance.. (2 Replies)
Discussion started by: masthan25
2 Replies

7. UNIX for Advanced & Expert Users

preserve guid:uid tar / cp

hello, i've a backup of a xen image which was tar'ed. i extracted the tarfile with --preserve and moved it to the lvm partition useing cp -p to preserve the ownership informations of the files in this step too. but unfortunatly after extracting the archive some uid and guids which are present... (5 Replies)
Discussion started by: coffeecup
5 Replies

8. UNIX for Dummies Questions & Answers

what is SUID/GUID bits in UNIX/Solaris

Hi, I have a Oracle Database on Solaris 5.10 . Following file are showing with SUID/GUID bits . -rwsr-xr-x root dba /optware/oracle/10.2.0.2/db/bin/extjob What will happen if this is changed to oracle dba . I need to know the will there be a effect if the owner of extjob is... (3 Replies)
Discussion started by: reply2soumya
3 Replies

9. UNIX for Dummies Questions & Answers

setuid

could u plz give me clear idea of spcial permissions setuid,getuid and striky bit . (1 Reply)
Discussion started by: Prem
1 Replies

10. UNIX for Advanced & Expert Users

setuid

I have a C wrapper programme which basically execute a shell script. The shell script has 700 as permission and oracle is owner of the shell script. The C execuatble has 4711 permission so that means that it has setuid bit set and group and others can execute the C executable. The reason why I am... (2 Replies)
Discussion started by: sanjay92
2 Replies
Login or Register to Ask a Question