I have Ubuntu 14.04 installed. I want to secure my folder. How can I add permissions to allow for write and read access and not removed the folder?
2 Answers
Write and removed permission in the linux system is same . If you set your folder permissions to writable , it can be removed . To secure your folder from everyone , I suggest you to type this command :
Example folder is /home/drajat :
chmod 700 -R /home/drajat
If you want to set your folder only read for everyone type this command :
chmod 744 -R /home/drajat
Info :
number 7 = its code to sent the system to make my folder is accessible(read only) , writable, and executable only for the owner(you) .
number 4 = its code to make your folder read for everyone , but they can write/removed and executable all file in your folder.
number 0 = its code to make every user and group in your system can't access , read and executable your folder .
- 303
Why are you concerned with the removal of the folder?
Removing of a folder can only happen when it's empty. And when you give write access inside the folder, all files can be removed.
If you want a folder available at all times, you can make a script to recreate it, if it was deleted.
[ ! -d *folder* ] && mkdir *folder*
- 61