linux 用户 配置
1. Add a new User
1 # add a new user 2 sudo adduser username
3 # add a new user to a group 4 sudo adduser username groupname
5 # add a new user foo to the group www-data 6 useradd -g www-data foo
https://superuser.com/questions/624745/ubuntu-server-create-group-create-user-user-specific-access
https://linuxhint.com/difference-between-useradd-adduser/
https://www.cyberciti.biz/faq/ubuntu-add-user-to-group-www-data/
Create a group
1 sudo addgroup groupname
2. Modify existing user
2.1 Change folder owner
chown restricted_user:group /restricted/directory chmod 755 /restricted/directory
https://askubuntu.com/questions/402980/give-user-write-access-to-folder
2.2 Adding an existing user to group
Add an existing user bar to Apache’s www-data group on Ubuntu using usermod -a -G www-data bar command.
2.3 Check the group a user is in
1 groups [username] 2 id [username]