Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUID and shell

Status
Not open for further replies.

jg156310

IS-IT--Management
Sep 22, 2003
26
0
0
FR
Hello,

my question : i want a shell read a file but i don't want that the users can read this file with the cat (or more...) command. This file contains an important user/password.

test done : i put a sticky bit on my shell and restricted access on my file.

Result : execution shell with root login = ok
execution shell with user login = ko (no access file)

my shell :
-r-sr-xr-x 1 root system 30 /home/prc/jpg.prc

my /home/fic/jpg.txt file :
-rwx------ 1 root system 34 /u/fic/jpg.txt

Other solution based on shell command ?

Thanks for answers.
 
if you give a file permissions of 700 (which you have), only the owner of that file will be able to cat the file. So, only root can cat /u/fic/jpg.txt.

If you want user:staff to be able to cat the file but no one else (except root) just change the ownership.

Does this answer your question?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top