file permissions - neočekivano
Postano: 20 srp 2012, 21:56
Naletio sam na ovaj interesantan post na redditu
http://www.reddit.com/r/linux/comments/ ... ese_years/
Nisam imao pojma ta file permissions tako funkcionira!
http://www.reddit.com/r/linux/comments/ ... ese_years/
Nisam imao pojma ta file permissions tako funkcionira!
I'm a long time *NIX admin and I recently discovered a serious flaw in my understanding of UNIX/Linux file and directory permissions. This is an embarrassing admission, but I'm sharing it just in case any of you have the same misunderstanding. Rather than explain, I'll just show you. Open a terminal and follow along.Note the permissions on "example". They should be something like 0775 (drwxrwxr-x) and the owner/group should be whatever user you're logged in with. Now create a file in the "example" directory:Kod: Označi sve
mkdir example ls -lAgain, note the permissions and the owner. Now change the owner and group to "root" and then make the file "un-anything-able":Kod: Označi sve
touch example/test.txt ls -l example/test.txtAgain (I know this is getting repetitive), note the permissions. Now, the quiz:Kod: Označi sve
sudo chown root.root example/test.txt sudo chmod 0000 example/test.txt ls -l example/test.txt
Who is the only user that should be able to write to the file "example/test.txt" ?