LINUX USERS, GROUPS & PERMISSIONS Eli the Computer Guy https://www.youtube.com/watch?v=zRw0SKaXSfI ADD USERS sudo adduser <username> prompts will be given, for fleshing out profile DELETE USERS sudo userdel <username> USER PROFILE INFO - TEXT FILE file location: /etc/passwd VIEW USERS ON LINUX sudo vim [or whatever text editor] /etc/passwd example other text editor: mousepad therefore variation of command: sudo mousepad /etc/password CHANGE USER'S PASSWORD sudo passwd <username> prompt will guide CONFIGURATION FILES CONTAINING USER INFO = CONTAINED IN TEXT FILE FORMAT /etc/passwd THREE DIGIT NUMBERS INDICATE PERMISSIONS Example: User, Group, Others 7, 7, 7 7 = full control (security risk, save for User - versus Group, Others)
php files are scripts to work they have to be executed (everyone needs at least a 1 permission to execute scripts on your website) (permission to write is out for Others (website visitors)) eg. website / web-server = min. 5 for 'Others' (ie read / execute) eg. full permissions = 7 | read-write permissions = 6 example: 7, 7, 5
-R = recursive (changes associated / permissions all the way down) example: sudo chmod 7,7,5 <foldername> -R chmod WITH NUMBERS
eg. -rw-rw-rwx permissions use the following: Owner Group Other read & write read & write read, write & execute 4+2=6 4+2=6 4+2+1=7 equals: 6, 6, 7 TO EXECUTE: sudo chmod 667 <foldername> Other Example: User Group Others 4+2+1 = 7 4 + 2 + 0 = 6 0 + 0 + 0 = 0 equals: 7, 6, 0 TO EXECUTE: sudo chmod 760 <foldername> LIST ALL PERMISSIONS command: ls -al LIST ALL FILES / FOLDERS [ in current directory ] command: ls -l permissions for folder shown - eg. drwxrwxrwx (completely open, bad security) ('d' represents 'directory' & balance is permissions) (permissions: Read, Write, eXecute) EXAMPLE: command to change: sudo chmod 755 <foldername> -R while in directory that requires change + add permission CHANGE OWNER FILES OR FOLDERS USER or GROUP can own file or folder OWNERSHIP CHANGE - USER sudo chown -R <username> <file or folder giving ownership of> Recursive -R for subsequent change to all files & subdirectories (if required) OWNERSHIP CHANGE - GROUP sudo chgrp -R <GroupName> <file or folder giving ownership of> |
TOKYO MASTER BANNER
MINISTRY OF TOKYO
|
June 21, 2016
Linux Permissions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment