Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.