[ TIL ] Operating System | Users, Superuser and Beyond

charco·2021년 9월 23일
0

나도TIL

목록 보기
20/55
post-custom-banner

Users, Superuser and Beyond

  • Standard User
  • Administrator
  • Root User -> automatically created when we install Linux.
    has all the privileges. super user

cat /etc/group -> list groups
sudo:x:27:kangchan

sudo : group name
x : it means that the password has been encrypted
27 : group id
kangchan : list of users in the group

changing password
passwd {username}
expire password so the user must reset the password
sudo passwd -e {username}

set default password for user and force them change the password themselves
so only the user knows his or her password.

Adding and Removing User

  • sudo useradd {username} -> add a user
  • sudo userdel {username} -> remove a user

File Permissions

  • Read
  • Write
  • Execute

ls -l ->

-rwxrw-r--

  • 1 (-) -> file type ex) d for directory
  • 2,3,4 (rwx) -> permission of owner of the fyle
  • 5,6,7 (rw-) -> permission of the group that the file belongs to
  • 8, 9, 10 (r--) -> permission of all users

r : readable
w : writable
x : executable

Modifying Permissions

u : owner
g : group
o : other users

chmod u+x {filename} -> give x permission to the owner of the file
chmod u-x {filename} -> remove x permission of the owner of the file

chown {username} {filename} -> change the owner of the file
chgrp {groupname} {filename} -> change the group that the file belongs to

SetUID, SetGUID, Sticky Bits

SetUID (s) -> allow a file to be run as the owner of the file
SetGID -> allow a file to be run as the group of the file
Sticky Bit (t) -> all permissions but can not delete
only the root can do it

profile
아직 배우는 중입니다
post-custom-banner

0개의 댓글