Skip to main content

0103 | Users and groups

Users and Groups

Working with users and Groups

users;who;w

  • currently logged in users
    • users;who;w
  • ls -la /home
  • groups do not have any passwords anymore
    • "/etc/groups" --> "x" in 2nd column
  • "*" in "/etc/passwd" --> disabled login

File and Directory Permissions

chmod;chown;chgrp

  • changing permissions
    • symbolic mode
      • chmod g-w hello.txt
      • chmod a=,u=r hello.txt
    • octal mode
      • chmod 664 hello.txt
  • changing owner/group | chown;chgrp
    • sudo chown sally hello.txt
    • sudo chgrp sally hello.txt

Changing Users

sudo;su

  • sudo cat /etc/passwd
  • sudo -u sally cat /home/sally/sample.txt
  • change user | su
    • su sally

Changing Passwords

passwd

  • for changing an other users password, sudo is needed
  • if using elevated privileges, no password requirements are tested