change permissions of a folder and everything in it
Give a folder, its subfolders and its files the permissions or the owner they need, without making them open to everyone.
filessecurityusers
danger Steps marked danger delete, overwrite or stop something. Read each one before you run it.
-
ls -ld foldersee the folder's permissions and owner now
-
chmod -R u+rwX,go+rX folderdanger you can read and write everything; others can read, and enter the folders
-
find folder -type d -exec chmod 755 {} +folders: rwx for you, r-x for everyone else
-
find folder -type f -exec chmod 644 {} +files: rw for you, read-only for everyone else
-
sudo chown -R NAME:GROUP folderdanger give the folder and everything in it to another owner
-
chmod +x script.shlet a file be run as a program
chmod -R 777lets every user change and delete everything: it is almost never the fix.- Capital
Xinu+rwXadds the x only to folders and to files that already had it.
chmodchownfindls
Each has a page in lore: lore chmod opens it.
check a file's permissions
See who may read, write and run a file or a folder, and why a path is refused.
who is logged in
See who is on this machine now, who was before, and the failed attempts.
add a user
Create an account with a home folder and a password, and let it use sudo if it should.
add to the end of a file
Add lines to a file without replacing it, also to a file only root can write.