set UID on linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting set UID on linux
# 1  
Old 09-20-2006
set UID on linux

Hi,
I just want to know if it's possible to set the UID bit for a script, so that it executes not as a owner of process, but owner of the script.

i.e
script tesh.sh owned by 'user1', 'file1' owned by user1 has 700 permisssions
`who am i`
rm -v /tmp/file1

user 2 need to execute test.sh,

so I would issue
chmod u+s test.sh first to set the UID

then ,
I would execute the script as user2, by doing so , i would expect the 'file1' to be removed, as I would expect the script is being executed as user1 and not user2. However it doesn't seem to happen ?

Any reasons why ??

Thanks
# 2  
Old 09-20-2006
A lot of systems don't support the setuid bit on scripts. If you write a C program and make that setuid, it should work.
# 3  
Old 09-21-2006
Thx, good to know that, can you or someone knows if this applicable to linux suse flavour also ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Setting UID and GID for shared folder using NFS method in Linux system

Hi everyone, have a good day to you. I am trying to use NFS to share a folder between 2 linux systems. Let's say the server which is sharing the folder is server A and the client which need to access this shared folder is server B. In server B, i am having a Joe user which UID and GID is 500.... (1 Reply)
Discussion started by: michael_hoang
1 Replies

2. Shell Programming and Scripting

Unable to set variables in Linux script

Hi, I am pretty new in writing shell script on LINUX, I tried to write the script just like KSH on HP unix but it seems nothing is working. Even assigning variables seems to be not working as KSH on HP unix. Please help in resolving the issues I am facing on LINUX. I have declared variables for... (5 Replies)
Discussion started by: smr.ryl
5 Replies

3. Red Hat

SEt two hostname in a linux server

Friends , Can I set two hostname in a Linux server at a time ? I want to give two hostname of my Linux server , is it possible to do ? Plz inform .. .. (2 Replies)
Discussion started by: shipon_97
2 Replies

4. Red Hat

Command to set locale for my linux machine

Hi, I need to set a locale to my linux machine which has redhat enterprise linux 4 how should I do that. And also when i did locale -a, I have got three versions for each locale type with different .extensions like utf8,iso88951 and soon which file should I use for setting locale. ... (1 Reply)
Discussion started by: eamani_sun
1 Replies

5. Linux

How Do I Set Internet With Linux

I am a new learner of linux, my friend told me that it is very good to learn linux, so I dropped the idea of deleting it but now I faced a problem again , how am I going to set my computer to connect to my ISP and other computers?? (1 Reply)
Discussion started by: terrychen0804
1 Replies

6. UNIX for Dummies Questions & Answers

how to set up linux environment variables?

Hi I'm using Linux, in the directory /root/my there is a.out. but when I try to run it , the shell indicate "bash:a.out: command not found" but I AM working in this directory. if I use "./a.out" , it works perfectly. can any body tell me how to do a permanent set up so that I can use... (5 Replies)
Discussion started by: dell9
5 Replies

7. UNIX for Dummies Questions & Answers

I need help to set up internet sharing in linux.

Ok, I'm kind of in between newbie and experienced somewhere. I'm an advanced computer user but only have a little experience with linux and a lot of problems with it. Currently I'm using Linux-Mandrake 8.0 (I know, I know, but let's not go into the many reasons why it's not even close to the best... (2 Replies)
Discussion started by: Nazo
2 Replies

8. Filesystems, Disks and Memory

Getting set up with Linux.

I want to install a Linux build on a partition of my Win2k machine, but I have a few questions first. 1) Which build should I choose? I was told that some Linux builds don't support some hardware. I am using an AMD Duron CPU, an NVidia Geforce2 MX video card, and a soundMAX (very cheap) audio... (6 Replies)
Discussion started by: Jaco
6 Replies

9. UNIX for Dummies Questions & Answers

How do I set up DHCP on Linux

I have linux box setup and connected to a cable modem via a hub which is shared with other win98 pcs. I need to set up the linux box with dhcp. I have two issues: First: For some reason, every time I activate the eth0 interface, it seems to deactivate itself after some time all by itself.... (1 Reply)
Discussion started by: alam
1 Replies

10. UNIX for Dummies Questions & Answers

set uid question w/ backup script

this is the backup script. When i run it as a non root or authority user i get the following errors for each filesystem being backedup. It then continues to the next fs. Do i have this set up correctly? am i missing something? backup: The backup command has ended abnormally. backup: 0511-225... (2 Replies)
Discussion started by: Optimus_P
2 Replies
Login or Register to Ask a Question