SlideShare a Scribd company logo
Gaurav Mishra
<gmishx@gmail.com>
Linux - 6
User Management
27-02-2018
Unrestricted
Gaurav Mishra <gmishx@gmail.com>
Users and groups
• Every file in Linux is owned by a user
which have access and control over it.
• System files are owned by root use.
• Each user belongs to at least one
group and one group can have more
than one user.
• The user can set access for other users
on their files.
• The access to a file is denoted using
the file mode bits.
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
File mode bits
• Every file have 10 file mode bits as follows:
▫ d rwx rwx rwx
▫ The first bit defines the file type
 - : Regular file.
 b : Block special file (stored in /dev).
 c : Character special file (stored in /dev).
 d : Directory.
 l : Symbolic link.
 p : FIFO.
 s : Socket.
 w : Whiteout.
▫ The second set of octets defines the access for the owner, third is for the group and
fourth is for others
 The first bit defines the read access
 The second bit defines the write access
 The third bit defines the execute access
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
Example
• -rw-rw-r-- optimus developers /home/optimus/project1/README.MD
• The string denotes that there is a file README.MD which is owned by the user
optimus and the group developers.
• From the file mode bits, we can derive that
▫ It is a regular file
▫ The owner has read and write access to the file
▫ The group has read and write access to the file
▫ Others can only read the file
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
User directories
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
/etc/passwd
• Whenever you create a user, a new
entry is created in /etc/passwd file.
• Each entry takes one line and each
field is separated by colons:
▫ Username
▫ Password
▫ UserID
▫ GroupID
▫ Comment
▫ Home Directory
▫ Login Shell
• The passwords are stored in
/etc/shadow file accessible only to
root in encrypted format for security.
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
User management commands
• Adding new user
▫ adduser [--ingroup GROUP] USER
• Adding new group
▫ addgroup [--gid ID] GROUP
• Listing users
▫ users [GROUP]
• Listing groups
▫ groups [USER]
• Adding user to a group
▫ usermod [-a] -G GROUP USER
• Changing password
▫ passwd [USER]
• Locking/unlocking login
▫ passwd -l USER / passwd -u USER
• Removing login password
▫ passwd -d [USER]
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
Access to file/directory
• Modifying access
▫ chmod <new-mod-bits> FILE/DIRECTORY
▫ chmod <+/-><r/w/x>[…] [u/g/o] FILE/DIRECTORY
▫ Adding write access to group
 chmod +w g /home/user/myfile
▫ Adding execute and removing write access to others
 chmod +x-w o /home/user/myfile
• Changing owner
▫ chown [USER][:GROUP] FILE/DIRECTORY
27-02-2018
Gaurav Mishra <gmishx@gmail.com>
Default access
• Whenever a directory or file is created, it is assigned a default access
• This default access can be checked and assigned by umask
• To check the current mask, enter umask
▫ user@host:~$ umask
▫ 0002
• To check the symbolic values, add -S option
▫ user@host:~$ umask -S
▫ u=rwx,g=rwx,o=rx
• The umask assigns the inverse of the bits set in the mask to the new file/directory
▫ umask 002 => 000 000 010 ~ => 111 111 101
• Setting default access to rwxr--r--
▫ umask 033
▫ umask -S u=rwx,g=r,o=r
27-02-2018
Ad

More Related Content

What's hot (20)

User management
User managementUser management
User management
Mufaddal Haidermota
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
SAMUEL OJO
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
Linux file system
Linux file systemLinux file system
Linux file system
Md. Tanvir Hossain
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
Harish R
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
Subashini Pandiarajan
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
Papu Kumar
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
william_morg
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Chinthaka Deshapriya (RHCA)
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
Linux
Linux Linux
Linux
Kevin James
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Linux basics
Linux basicsLinux basics
Linux basics
Santosh Khadsare
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
onu9
 
Lec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptxLec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptx
ShabanaShafi3
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 
Linux File System
Linux File SystemLinux File System
Linux File System
Anil Kumar Pugalia
 
Linux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating SystemLinux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating System
Vibrant Technologies & Computers
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
SAMUEL OJO
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
Harish R
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
Papu Kumar
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
william_morg
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Chinthaka Deshapriya (RHCA)
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
onu9
 
Lec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptxLec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptx
ShabanaShafi3
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 

Similar to Linux User Management (20)

06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
Shay Cohen
 
Week7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).pptWeek7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).ppt
no22rah1
 
Week7. linux. operating. system. .ppt
Week7.  linux.  operating.  system. .pptWeek7.  linux.  operating.  system. .ppt
Week7. linux. operating. system. .ppt
no22rah1
 
Apache, cron and proxy
Apache, cron and proxyApache, cron and proxy
Apache, cron and proxy
Gaurav Mishra
 
7 - User Administration in Red Hat
7 - User Administration in Red Hat7 - User Administration in Red Hat
7 - User Administration in Red Hat
Shafaan Khaliq Bhatti
 
Disk quota and sysd procd
Disk quota and sysd procdDisk quota and sysd procd
Disk quota and sysd procd
Gaurav Mishra
 
chapter11.. linux. Managing Users . ppt
chapter11.. linux.  Managing Users . pptchapter11.. linux.  Managing Users . ppt
chapter11.. linux. Managing Users . ppt
no22rah1
 
Linux training in chandigarh.pptx Join Now
Linux training in chandigarh.pptx Join NowLinux training in chandigarh.pptx Join Now
Linux training in chandigarh.pptx Join Now
asmeerana605
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
Basic linux day 5
Basic linux day 5Basic linux day 5
Basic linux day 5
Saikumar Daram
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linux
Sreenatha Reddy K R
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3
Acácio Oliveira
 
wget, curl and scp
wget, curl and scpwget, curl and scp
wget, curl and scp
Gaurav Mishra
 
4.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v34.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v3
Acácio Oliveira
 
Ch11
Ch11Ch11
Ch11
Ameha Gero
 
Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
Information Technology
 
Linux lecture
Linux lectureLinux lecture
Linux lecture
Paktia University
 
Special permission in linux.
Special permission in linux.Special permission in linux.
Special permission in linux.
Md Meherab Hossen
 
Net essentials6e ch9
Net essentials6e ch9Net essentials6e ch9
Net essentials6e ch9
APSU
 
Net essentials6e ch9
Net essentials6e ch9Net essentials6e ch9
Net essentials6e ch9
APSU
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
Shay Cohen
 
Week7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).pptWeek7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).ppt
no22rah1
 
Week7. linux. operating. system. .ppt
Week7.  linux.  operating.  system. .pptWeek7.  linux.  operating.  system. .ppt
Week7. linux. operating. system. .ppt
no22rah1
 
Apache, cron and proxy
Apache, cron and proxyApache, cron and proxy
Apache, cron and proxy
Gaurav Mishra
 
Disk quota and sysd procd
Disk quota and sysd procdDisk quota and sysd procd
Disk quota and sysd procd
Gaurav Mishra
 
chapter11.. linux. Managing Users . ppt
chapter11.. linux.  Managing Users . pptchapter11.. linux.  Managing Users . ppt
chapter11.. linux. Managing Users . ppt
no22rah1
 
Linux training in chandigarh.pptx Join Now
Linux training in chandigarh.pptx Join NowLinux training in chandigarh.pptx Join Now
Linux training in chandigarh.pptx Join Now
asmeerana605
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linux
Sreenatha Reddy K R
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3
Acácio Oliveira
 
4.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v34.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v3
Acácio Oliveira
 
Special permission in linux.
Special permission in linux.Special permission in linux.
Special permission in linux.
Md Meherab Hossen
 
Net essentials6e ch9
Net essentials6e ch9Net essentials6e ch9
Net essentials6e ch9
APSU
 
Net essentials6e ch9
Net essentials6e ch9Net essentials6e ch9
Net essentials6e ch9
APSU
 
Ad

More from Gaurav Mishra (8)

FOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and AutomationFOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and Automation
Gaurav Mishra
 
FOSSology & GSOC Journey
FOSSology & GSOC JourneyFOSSology & GSOC Journey
FOSSology & GSOC Journey
Gaurav Mishra
 
Block Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchangeBlock Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchange
Gaurav Mishra
 
Block Chain - Introduction
Block Chain - IntroductionBlock Chain - Introduction
Block Chain - Introduction
Gaurav Mishra
 
Backup using rsync
Backup using rsyncBackup using rsync
Backup using rsync
Gaurav Mishra
 
Linux Run Level
Linux Run LevelLinux Run Level
Linux Run Level
Gaurav Mishra
 
Firewall and IPtables
Firewall and IPtablesFirewall and IPtables
Firewall and IPtables
Gaurav Mishra
 
Linux securities
Linux securitiesLinux securities
Linux securities
Gaurav Mishra
 
FOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and AutomationFOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and Automation
Gaurav Mishra
 
FOSSology & GSOC Journey
FOSSology & GSOC JourneyFOSSology & GSOC Journey
FOSSology & GSOC Journey
Gaurav Mishra
 
Block Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchangeBlock Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchange
Gaurav Mishra
 
Block Chain - Introduction
Block Chain - IntroductionBlock Chain - Introduction
Block Chain - Introduction
Gaurav Mishra
 
Firewall and IPtables
Firewall and IPtablesFirewall and IPtables
Firewall and IPtables
Gaurav Mishra
 
Ad

Recently uploaded (20)

HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 

Linux User Management

  • 1. Gaurav Mishra <[email protected]> Linux - 6 User Management 27-02-2018 Unrestricted
  • 2. Gaurav Mishra <[email protected]> Users and groups • Every file in Linux is owned by a user which have access and control over it. • System files are owned by root use. • Each user belongs to at least one group and one group can have more than one user. • The user can set access for other users on their files. • The access to a file is denoted using the file mode bits. 27-02-2018
  • 3. Gaurav Mishra <[email protected]> File mode bits • Every file have 10 file mode bits as follows: ▫ d rwx rwx rwx ▫ The first bit defines the file type  - : Regular file.  b : Block special file (stored in /dev).  c : Character special file (stored in /dev).  d : Directory.  l : Symbolic link.  p : FIFO.  s : Socket.  w : Whiteout. ▫ The second set of octets defines the access for the owner, third is for the group and fourth is for others  The first bit defines the read access  The second bit defines the write access  The third bit defines the execute access 27-02-2018
  • 4. Gaurav Mishra <[email protected]> Example • -rw-rw-r-- optimus developers /home/optimus/project1/README.MD • The string denotes that there is a file README.MD which is owned by the user optimus and the group developers. • From the file mode bits, we can derive that ▫ It is a regular file ▫ The owner has read and write access to the file ▫ The group has read and write access to the file ▫ Others can only read the file 27-02-2018
  • 6. Gaurav Mishra <[email protected]> /etc/passwd • Whenever you create a user, a new entry is created in /etc/passwd file. • Each entry takes one line and each field is separated by colons: ▫ Username ▫ Password ▫ UserID ▫ GroupID ▫ Comment ▫ Home Directory ▫ Login Shell • The passwords are stored in /etc/shadow file accessible only to root in encrypted format for security. 27-02-2018
  • 7. Gaurav Mishra <[email protected]> User management commands • Adding new user ▫ adduser [--ingroup GROUP] USER • Adding new group ▫ addgroup [--gid ID] GROUP • Listing users ▫ users [GROUP] • Listing groups ▫ groups [USER] • Adding user to a group ▫ usermod [-a] -G GROUP USER • Changing password ▫ passwd [USER] • Locking/unlocking login ▫ passwd -l USER / passwd -u USER • Removing login password ▫ passwd -d [USER] 27-02-2018
  • 8. Gaurav Mishra <[email protected]> Access to file/directory • Modifying access ▫ chmod <new-mod-bits> FILE/DIRECTORY ▫ chmod <+/-><r/w/x>[…] [u/g/o] FILE/DIRECTORY ▫ Adding write access to group  chmod +w g /home/user/myfile ▫ Adding execute and removing write access to others  chmod +x-w o /home/user/myfile • Changing owner ▫ chown [USER][:GROUP] FILE/DIRECTORY 27-02-2018
  • 9. Gaurav Mishra <[email protected]> Default access • Whenever a directory or file is created, it is assigned a default access • This default access can be checked and assigned by umask • To check the current mask, enter umask ▫ user@host:~$ umask ▫ 0002 • To check the symbolic values, add -S option ▫ user@host:~$ umask -S ▫ u=rwx,g=rwx,o=rx • The umask assigns the inverse of the bits set in the mask to the new file/directory ▫ umask 002 => 000 000 010 ~ => 111 111 101 • Setting default access to rwxr--r-- ▫ umask 033 ▫ umask -S u=rwx,g=r,o=r 27-02-2018