Linux Classroom notes 25/July/2026

linux – user, group and file permissions

users:

A user is account to login and own files/process in linux

Types of users:

  • root user: superuser having full access
  • system user: created user for services EX: mysql, sql, oracle, tomcat
  • Regular : Human account – people login to linux
whoami - this will give user which is currently active

useradd - ```sudo useradd devloper``` - low level user

password - create password for user ```sudo passwrd devloper```

adduser  - interactive action ```sudo adduser qt-admin```

su username - switch to users ```sudo su qt-admin```

Group – collection of users and provide permissions to file and directories.

  • groups – show all groups in linux machine specific user

  • create group sudo groupadd dev

  • cat /etc/group – show all groups

  • Add user to specific group- sudo usermod -aG dev qt-admin

  • groupdel stg – delete group

  • sudo gpasswd -d username groupname ex: sudo gpasswd -d qt-admin dev

File permissions

-rw-r–r– 1 root root 5684 Jul 24 02:03 logfile.txt

  • type of file ex: – is file, d is directory , l -link (soft/hard)

rw- first will be user permissions root (user)

r– group permissions ex: dev, admin, qa (group)

r– others

permissions in linux files

  • read -r
  • wirte -w
  • excute- x

two ways provide acces

symbolic method

user – u group -g other -o

  • sudo chmod u+x filename – give execute permissions to user

  • sudo chmod ugo+x – provide excute access for all

  • sudo chmod ugo+xrw logfile.txt – add full permissions

  • sudo chmod go-w logfile.txt – remove permissions

  • sudo chmod -R u+rwx,g+rx,o+r src – provide different access ugo

Numeric method

read – 4

wirte – 2

excute – 1

no access – 0

  • user -rwx, group- rx , other -x

4+2+1, 4+1, 1 = 751


sudo chmod 751 filename

Task:

  • create 10 users and 2 groups
  • create files and give group permissions
  • check acccess for file

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube