SlideShare a Scribd company logo
USER
MANAGEMENT
LINUX
MUFADDAL HAIDERMOTA
BASIC COMMANDS
Local accounts or users in Linux like operating system is managed by commands such as :
 useradd – Create new accounts.
 usermod – Modify existing accounts.
 userdel – Delete local account.
 chage – View and modify users password expiry information.
 Passwd – Assign password to local accounts/users.
NOTE :
 When a user is created in Linux followings are updated:
 A home directory is created under ‘/home/<username>’
 User info is updated in ‘/etc/passwd’ file
 Group Information is stored in ‘/etc/group’
 password info is updated in ‘/etc/shadow’ file.
 File for user’s email is created under ‘/var/spool/mail/<username>’
The following hidden files are copied into the user’s home directory, and will be used to provide environment
variables for his/her user session.
 .bash_logout
 .bash_profile
 .bashrc
The full account information is stored in the /etc/passwd file. This file contains a record per system user
account and has the following format (fields are delimited by a colon).
[username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell]
 The x in the second field indicates that the account is protected by a shadowed password (in /etc/shadow),
which is needed to logon as [username].
 The [UID] and [GID] fields are integers that represent the User IDentification and the primary Group
IDentification to which [username] belongs, respectively.
 The [Home directory] indicates the absolute path to [username]’s home directory, and
 The [Default shell] is the shell that will be made available to this user when he or she logins the system.
ERROR SCENARIO 1 : PERMISSION DENIED
 The command useradd needs some special privilege to modify the system settings. Hence,
you get a permission denied when using it as a normal user.
 To be able to call useradd from a normal user, you need to configure sudo
ERROR SCENARIO 1:
LOCK FILES
SOLUTION
 cd /etc
ls –l *.lock
 rm –rf /etc/sample.lock
ERROR SCENARIO 2: CANNOT VIEW/MODIFY
PASSWORD INFO. FOR OTHER USER
SOLUTION
VERIFICATION
MODIFY USER
MODIFY PASSWORD
SETTINGS
LINUX/UNIX USER MANAGEMENT COMMANDS
Command Description
sudo adduser username Adds a user
sudo passwd -l 'username’ Disable a user
sudo userdel -r 'username’ Delete a user.
-r option is used to delete user along with the user’ s
home directory and mail spool
sudo usermod -a -G GROUPNAME USERNAME Add user a to a usergroup
sudo deluser USER GROUPNAME Remove user from a user group
Finger Gives information on all logged in user
finger username Gives information of a particular user
USER ACCOUNT WITH NO LOGIN
 Another way to add a user with no login is to edit the /etc/passwd file.
 In /etc/passwd file replace /bin/bash with /sbin/nologin for the user you’ re going to restrict
login.
ROOT ACESSS TO A
USER
 Run sudo -i. This will give you an
interactive root shell. Note that the $
at the end of your prompt has
changed to a #, indicating that you
have root access.
 From here you can run any sequence
of commands as root, or run the
command exit to leave the root shell.
GIVING USER ROOT
PRIVILEGES
GROUP MANAGEMENT
There are two types of groups in Linux, they are
 Primary group
 Secondary or Supplementary group
Primary group
To add a user to a Primary group, use the following user
mod command as root,
Syntax: usermod -g [groupname] [username]
Secondary Group
A user can be added to a secondary group using the
following command.
Syntax: usermod -G [groupname] [username]
FYI
 To change a password for root user on Ubuntu Linux, run: sudo passwd root
 To change your own password for Ubuntu, execute: passwd
 Create a new group with specific gid: groupadd -G 999 groupname
 Users can change their login shell with chsh / chsh -s command.
Syntax: chsh -s <newShell> Example: chsh -s /bin/sh
 https://www.linuxtechi.com/linux
-commands-to-manage-local-
accounts/
 https://www.linuxhelp.com/user-
management-commands

More Related Content

What's hot

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
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
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
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Edureka!
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
Ahmed El-Arabawy
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
Subashini Pandiarajan
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
Sagar Kumar
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
Server configuration
Server configurationServer configuration
Server configuration
Aisha Talat
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
Zkre Saleh
 
Linux kernel
Linux kernelLinux kernel
Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
Systems Administration
Systems AdministrationSystems Administration
Systems Administration
Mark John Lado, MIT
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
Henry Osborne
 

What's hot (20)

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
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
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
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Server configuration
Server configurationServer configuration
Server configuration
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux
Linux Linux
Linux
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Systems Administration
Systems AdministrationSystems Administration
Systems Administration
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 

Similar to User management

A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ HostbilloA Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
KiyanaSharma1
 
Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
Information Technology
 
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
 
ManagingLocalLinuxUsersandGroups(2)
ManagingLocalLinuxUsersandGroups(2)ManagingLocalLinuxUsersandGroups(2)
ManagingLocalLinuxUsersandGroups(2)Bipul Kumar
 
Sudo
SudoSudo
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
Harish R
 
Sudo &amp; su commands
Sudo &amp; su commandsSudo &amp; su commands
Sudo &amp; su commands
Meenu Chopra
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
 
7 unixsecurity
7 unixsecurity7 unixsecurity
7 unixsecurityricharddxd
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
Shay Cohen
 
Linux lecture
Linux lectureLinux lecture
Linux lecture
Paktia University
 
Presentation1
Presentation1Presentation1
Presentation1
Engr Zardari Saddam
 
System Administeration Basics
System Administeration  BasicsSystem Administeration  Basics
System Administeration Basics
Bahaa Salama
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
We Ihaveapc
 
User Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdfUser Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdf
LinuxTeck
 
How to add user in system without useradd command
How to add user in system without useradd commandHow to add user in system without useradd command
How to add user in system without useradd command
Akshay Ithape
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
Dinesh jaisankar
 
Day4 ubuntu boot camp
Day4 ubuntu boot campDay4 ubuntu boot camp
Day4 ubuntu boot camp
Darlene Parker
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeQasim Khawaja
 

Similar to User management (20)

A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ HostbilloA Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
 
Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
 
ManagingLocalLinuxUsersandGroups(2)
ManagingLocalLinuxUsersandGroups(2)ManagingLocalLinuxUsersandGroups(2)
ManagingLocalLinuxUsersandGroups(2)
 
Sudo
SudoSudo
Sudo
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Sudo &amp; su commands
Sudo &amp; su commandsSudo &amp; su commands
Sudo &amp; su commands
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
 
7 unixsecurity
7 unixsecurity7 unixsecurity
7 unixsecurity
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
Linux lecture
Linux lectureLinux lecture
Linux lecture
 
Presentation1
Presentation1Presentation1
Presentation1
 
System Administeration Basics
System Administeration  BasicsSystem Administeration  Basics
System Administeration Basics
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
 
User Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdfUser Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdf
 
How to add user in system without useradd command
How to add user in system without useradd commandHow to add user in system without useradd command
How to add user in system without useradd command
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
Day4 ubuntu boot camp
Day4 ubuntu boot campDay4 ubuntu boot camp
Day4 ubuntu boot camp
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
 
Ch11
Ch11Ch11
Ch11
 

More from Mufaddal Haidermota

Monad
MonadMonad
Shell scripting
Shell scriptingShell scripting
Shell scripting
Mufaddal Haidermota
 
Azure lessons
Azure lessonsAzure lessons
Azure lessons
Mufaddal Haidermota
 
Data Literacy
Data LiteracyData Literacy
Data Literacy
Mufaddal Haidermota
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
Mufaddal Haidermota
 
B.E Project: Detection of Bots on Twitter
B.E Project: Detection of Bots on TwitterB.E Project: Detection of Bots on Twitter
B.E Project: Detection of Bots on Twitter
Mufaddal Haidermota
 

More from Mufaddal Haidermota (6)

Monad
MonadMonad
Monad
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Azure lessons
Azure lessonsAzure lessons
Azure lessons
 
Data Literacy
Data LiteracyData Literacy
Data Literacy
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
 
B.E Project: Detection of Bots on Twitter
B.E Project: Detection of Bots on TwitterB.E Project: Detection of Bots on Twitter
B.E Project: Detection of Bots on Twitter
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

User management

  • 2. BASIC COMMANDS Local accounts or users in Linux like operating system is managed by commands such as :  useradd – Create new accounts.  usermod – Modify existing accounts.  userdel – Delete local account.  chage – View and modify users password expiry information.  Passwd – Assign password to local accounts/users. NOTE :  When a user is created in Linux followings are updated:  A home directory is created under ‘/home/<username>’  User info is updated in ‘/etc/passwd’ file  Group Information is stored in ‘/etc/group’  password info is updated in ‘/etc/shadow’ file.  File for user’s email is created under ‘/var/spool/mail/<username>’
  • 3. The following hidden files are copied into the user’s home directory, and will be used to provide environment variables for his/her user session.  .bash_logout  .bash_profile  .bashrc The full account information is stored in the /etc/passwd file. This file contains a record per system user account and has the following format (fields are delimited by a colon). [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell]  The x in the second field indicates that the account is protected by a shadowed password (in /etc/shadow), which is needed to logon as [username].  The [UID] and [GID] fields are integers that represent the User IDentification and the primary Group IDentification to which [username] belongs, respectively.  The [Home directory] indicates the absolute path to [username]’s home directory, and  The [Default shell] is the shell that will be made available to this user when he or she logins the system.
  • 4. ERROR SCENARIO 1 : PERMISSION DENIED  The command useradd needs some special privilege to modify the system settings. Hence, you get a permission denied when using it as a normal user.  To be able to call useradd from a normal user, you need to configure sudo
  • 5. ERROR SCENARIO 1: LOCK FILES SOLUTION  cd /etc ls –l *.lock  rm –rf /etc/sample.lock
  • 6. ERROR SCENARIO 2: CANNOT VIEW/MODIFY PASSWORD INFO. FOR OTHER USER SOLUTION
  • 10. LINUX/UNIX USER MANAGEMENT COMMANDS Command Description sudo adduser username Adds a user sudo passwd -l 'username’ Disable a user sudo userdel -r 'username’ Delete a user. -r option is used to delete user along with the user’ s home directory and mail spool sudo usermod -a -G GROUPNAME USERNAME Add user a to a usergroup sudo deluser USER GROUPNAME Remove user from a user group Finger Gives information on all logged in user finger username Gives information of a particular user
  • 11. USER ACCOUNT WITH NO LOGIN  Another way to add a user with no login is to edit the /etc/passwd file.  In /etc/passwd file replace /bin/bash with /sbin/nologin for the user you’ re going to restrict login.
  • 12. ROOT ACESSS TO A USER  Run sudo -i. This will give you an interactive root shell. Note that the $ at the end of your prompt has changed to a #, indicating that you have root access.  From here you can run any sequence of commands as root, or run the command exit to leave the root shell.
  • 14. GROUP MANAGEMENT There are two types of groups in Linux, they are  Primary group  Secondary or Supplementary group Primary group To add a user to a Primary group, use the following user mod command as root, Syntax: usermod -g [groupname] [username] Secondary Group A user can be added to a secondary group using the following command. Syntax: usermod -G [groupname] [username]
  • 15. FYI  To change a password for root user on Ubuntu Linux, run: sudo passwd root  To change your own password for Ubuntu, execute: passwd  Create a new group with specific gid: groupadd -G 999 groupname  Users can change their login shell with chsh / chsh -s command. Syntax: chsh -s <newShell> Example: chsh -s /bin/sh