Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I created a /downloadz directory where Internet downloads automatically go to. I want to keep some of these files write-protected so that no one but root can delete them but I'm not sure how. Here is what I tried:
Alright, I can tell you. You need to make the owner of the file root, you can let other users access it but not delete it.
I'm not familiar with how to do this in the terminal but in konqueror in KDE 3.2 there is a sticky option that you need to check so that other users can't delete it.
When the sticky bit is set on a directory, files in that
directory may be unlinked or renamed only by root or their
owner. Without the sticky bit, anyone able to write to
the directory can delete or rename files. The sticky bit
is commonly found on directories, such as /tmp, that are
I tried doing this on my home dir. So for example:
1. cd /home/twantrd
2. touch test.txt; chmod 644 test.txt; chown root.root test.txt
1. ls -al /home/twantrd = -rw-r--r--
2. rm test.txt (works)
So, I need to create the sticky bit on /home/twantrd (and all other home directories) to prevent others from deleting 'test.txt'?? I thought the sticky bit was used so that normal users can execute binaries/scripts as root. Am i wrong?
If you look at permission on /root it is = drwxr-xr-x
There is no sticky bit there as you can tell. I created a file called 'twantrdtest.txt' and did same steps as root. However, normal users cannot delete that file. WHY?
I don't think you need to worry about the "sticky bit" stuff just to do this. Whether or not a user can delete a file depends on whether or not the user has write permission on the file's directory. So if you wanted to keep everybody but the file's owner from deleting it, you could do "chmod go-w /directory/the/file/is/in/".
The directory has -rw-r--r--. There is no 'write' bit on the directory but the user can still delete it. My only guess is the sticky bit. How can you tell that the sticky bit is in place?? Just do 'ls -al' and you should see something like rws-r-sr-s.....something like that?