Problem with permissions and vi

Anthony M. Rasat anthony.rasat at
Tue Dec 2 02:55:06 PST 2008

>Why I am able to put some text into >some_file.txt with
>chmod 000 using vi editor and why i >can not do the same
>using echo???

I'm not exactly vi master or guru here but I think it's because you write vi with :wq! command. If you write tried to write some_file.txt with :w instead, vi would complaints "cannot wrote blablabla" and so on.

I assumed you wanted to write-protect your file from unauthorised tempering attempt (either from you or other user) you can do that by changing ownership of the file to other user's, most popular probably to root's. I don't think vi can overwrite different owner's file unless permission flag's permit it.



Anthony M. Rasat
Manager - Technical, Network and Support Division
PT. Jawa Pos National Network
Graha Pena Jawa Pos Group Building, 5th floor
Jln. Raya Kebayoran Lama 12, Jakarta Barat 12210
Phone 02132185562
Phone 081574217035
Fax 02153651465

More information about the freebsd-questions mailing list