Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 12.04 x64 server on ext4 partition.

I set a directory's permission to '766' as below.

sudo chmod 766 /archive

drwxrw-rw- 3 root root 4096 Sep 27 10:50 archive/


But, when I tried to create new file through vi editor, permission error has occured.

vi /archive/test.txt
-------- > "/archive/test.txt" [Permission Denied]



I thought I had "write" permission.

Could anyone help me what is the problem?

share|improve this question
    
the vi command is running with root user too ? –  Andrés Ricardo Torres Martínez Sep 27 '12 at 3:39
add comment

1 Answer

I guess that the directory /archive already contains a file called test.txt, maybe created previously by the root. If so, then you have to either remove it, or change the permissions accordingly. Try

chmod -R 766 /archive

This will change the permissions recursively for all files and directories in the archive.

However, what are you trying to accomplish? In most cases it is not necessary to set such permissive permissions.

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.