Created
February 17, 2022 05:29
-
-
Save InnovArul/ef61b6d27657657b1e0719ea7717d3d3 to your computer and use it in GitHub Desktop.
create users - ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command: | |
-------- | |
sudo useradd -m -d /home/<user> -s /bin/bash -c "<rollnumber>" -U <user> | |
password: | |
--------- | |
sudo passwd <user> | |
Add user to sudo | |
----------------- | |
usermod -aG sudo <username> | |
mkdir /media/data/<username> | |
give permission to user folder | |
------------------------------ | |
sudo chown root:root <userfolder> | |
sudo chmod gu+rwx,o+rx file | |
sudo setfacl -m u:<user>:rwx <userfolder> | |
HELP: | |
----- | |
giving permissions | |
------------------- | |
chmod u=rx file (Give the owner rx permissions, not w) | |
chmod go-rwx file (Deny rwx permission for group, others) | |
chmod g+w file (Give write permission to the group) | |
chmod a+x file1 file2 (Give execute permission to everybody) | |
chmod g+rx,o+x file (OK to combine like this with a comma) | |
mounting drives | |
--------------- | |
sudo mount /dev/sdd /media/Data1 | |
sudo mount /dev/sdb /media/Data2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment