Guest User

Untitled

a guest
Dec 16th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. chown root:root /home
  4.  
  5. chmod 755 /home
  6.  
  7. USERS=$(grep '/home' /etc/passwd | tr "\n" "\n")
  8.  
  9. for USER in $USERS
  10. do
  11. IFS=":" read -ra DETAILS <<< "$USER"
  12.  
  13. $(chown -R ${DETAILS[0]}:${DETAILS[0]} ${DETAILS[5]})
  14.  
  15. $(chmod -R 750 ${DETAILS[5]})
  16. done
Add Comment
Please, Sign In to add comment