linux user groups and permissions

9 bit model: drwxrwx---

  1. create user/delete user:
    sudo useradd -m jack
    sudo passwd jack
    sudo userdel -r jack

  2. add groups
    sudo groupadd students
    sudo groupadd teacher
    sudo usermod -a -G students jack

  3. set permission

  • chown, chmod
    sudo chown -R :students /home/assignments
    sudo chmod -R g+rwx assignments/
  • setfacl
sudo setfacl -m g:Teachers:rwx -R /home/exam
getfacl exam
sudo setfacl -m g:students:--- -R /home/exam

mask is the upper bound privileges. mask is a union of all users.

  1. add user to sudoers (solve issues of "username is not in sudoers")
    add to sudo group
    sudo usermod -aG sudo adam
    groups adam
    visudo /etc/sudoers
    check if there exists a line of
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

3 Ways to Change a Users Default Shell in Linux

https://www.tecmint.com/change-a-users-default-shell-in-linux/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • User identity managementUID(User Identification)UID of Ad...
    宣雄民閱讀 425評(píng)論 0 0
  • Linux上的文件管理類命令都有哪些,其常用的使用方法及其相關(guān)示例演示。 1.chown chown將指定文件的擁...
    jyt802341閱讀 364評(píng)論 0 0
  • list:1.輸入、輸出重定向;2.tr 轉(zhuǎn)換或刪除字符;3. | 管道;4.tee 重定向到多個(gè)目標(biāo); 5.rz...
    溪云初起日沉閣l閱讀 688評(píng)論 0 2
  • 一、顯示/etc目錄下,非字母開(kāi)頭,后面跟了一個(gè)字母以及其他任意長(zhǎng)度任意字符的文件或目錄 命令: ls [...
    _檸檬氣泡水_閱讀 431評(píng)論 0 1
  • 一、文件相關(guān) 1. 文件管理 >創(chuàng)建空文件、覆蓋文件內(nèi)容、標(biāo)準(zhǔn)輸出重定向 >>創(chuàng)建空文件(更為安全的做法)、標(biāo)準(zhǔn)輸...
    Kin丶閱讀 683評(píng)論 0 1

友情鏈接更多精彩內(nèi)容