Creating-User/Project
Author: Neil Jianzhang Ni
Date: 21-May-2024
New User
Ask the user to provide the work email, and use that as the username.
sudo useradd -m -s /bin/bash <user_name> # create a new user
sudo passwd <user_name> # set the password for the user
sudo mkdir -p /data/people/<user_name>
sudo chown -R <user_name>:<user_name> /data/people/<user_name>
sudo chmod 700 /data/people/<user_name>
New Project
For each project, create a folder under /data/projects with the project name.
sudo mkdir /data/projects/<project_name>
Access Control
Set the appropriate permissions for the project directory.
sudo groupadd <project_group> # create a group for the project personnel
sudo usermod -aG <project_group> <user_name> # add the user to the project group
sudo chown -R <user_name/project_group>:<user_name/project_group> /data/projects/<project_name>
The corresponding project members should store their data in this directory, and not the home directory. And if they prefer to use the home directory, they should create a symbolic link to the project directory.
Table of Contents