Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For some special purpose, I want to prevent non-root users of the Linux Server from changing the filenames. However, they can modify and write to the contents of the file. How to do this from command line.

share|improve this question
3  
Duplicate of unix.stackexchange.com/questions/93399/…; please don't post on multiple sites simultaneously! –  Ingo Karkat Oct 3 '13 at 8:49
    
Also, what is that "special purpose" (it might help getting better answers), and what have to found / tried?! –  Ingo Karkat Oct 3 '13 at 8:51
1  
Also cross posted at askubuntu.com/questions/353054 –  David Foerster Oct 3 '13 at 9:12
add comment

1 Answer

up vote 2 down vote accepted

as root:

> mkdir -m 0755 testdir
> touch testdir/testfile
> chmod 0666 testdir/testfile

as guest:

> echo test > testdir/testfile
> mv testdir/testfile testdir/foobar
mv: cannot move `testdir/testfile' to `testdir/foobar': Permission denied

Works for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.