0% found this document useful (0 votes)
2 views24 pages

User management

The document outlines user management in a Linux environment, detailing user creation, UID and GID information, and password management. It explains how to manage user groups, change ownership of files and directories, and the implications of group inheritance. Additionally, it covers commands for checking user and group information, as well as deleting users while retaining their home directories.

Uploaded by

mani.hen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views24 pages

User management

The document outlines user management in a Linux environment, detailing user creation, UID and GID information, and password management. It explains how to manage user groups, change ownership of files and directories, and the implications of group inheritance. Additionally, it covers commands for checking user and group information, as well as deleting users while retaining their home directories.

Uploaded by

mani.hen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

User Management

User Management
• We create user
john .when you run
cat /etc/passwd you
will see the
information for john
• 1st 1001 is UID
• 2nd 1001 is GID
• Password information is saved
in /etc/shadow

• John is using bash shell

• John home directory is bash

• !!! means the password has not


been created

• 17600:0:99999:7::: it shows
aging information .After how
long it will expire the password
Password
• User “tab tab” can give you different options
• X in /etc/passwd means password has been saved in etc/shadow
• Linux understand UID so if you change john user id to 0 then will be root
• To change the user id first we need to check it has
been used before or not
• We change the user id of john from 1001 to 7070
• You can use id to see who has logged in by id OR whoami commands
• We create few files under john home
directory then we exit
• We delete user john
• After going to cd /home/john we see the files
are there even user john is deleted
• In production we delete the user but we keep
their home directory as the files there
• If you want to delete the home directory then
run it with -r
• We create two different supplementary group – dba and apps
• When we add apps it will overwrite dba supplementary group
• -G is for secondary or supplementary group
• Our primary group is john
• So to avoid it we run –a and as you can see both groups are there
• If you want to change the primary group from john to dba you use “-g”
• cat /etc/group will provide you the group information
• To check the property of
directory we run ls –ld /etc
• To check the contents of directory we run ls –l /etc
• We change the permission of file 1
• To change the owner I use chown
• To change the group owner we use chgrp. We change the group owner from root to dba
• You logged in as root and you created a directory named “Apps”
• We changed the owner from root to john for directory apps (chown)
• We changed the owner group from root to apps for directory apps (chgrp)
• Owner group for apps directory is apps
• If we create files under apps directory the owner group
will be root not apps so its not inherited
• Group owner can inherit when you use g+s
• Ls –ld can be run to show the property of directory
• S means its inherited
• When you create new files in apps directory like abc* you
noticed that the owner group has been changed to apps
• To remove we use g-s

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy