Skip to content

panwar100/linux-user-and-group-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

linux-user-and-group-guide

Table of Contents

  1. Search Words
  2. Run Multiple Commands
  3. Pipe Command
  4. User Management
  5. Group Management
  6. Assign Permissions for User Management

1) Search Words

Command: grep

Screenshot from 2024-11-29 10-54-35

Description: Searches the text file f1.txt for lines containing the word a (case-insensitive).

2) Run Multiple Commands

Screenshot from 2024-11-29 10-57-40

Description:

  • Lists the files and directories in the current path.
  • Creates a directory named abc.
  • Creates an empty file named f30.
  • Lists the updated files and directories.
  • End of line ;

3) Pipe Command

Screenshot from 2024-11-29 11-03-23

Description:

  • output of ls -l work as input of head -n 6

Screenshot from 2024-11-29 11-09-57

Description:

  • Lists files with detailed information.
  • Extracts the first 20 lines.
  • Retrieves the last 5 of those 20 lines.
  • Displays the first of the 5 lines.

4) User Management

Create a User

Screenshot from 2024-11-29 11-13-02

View All Users

Screenshot from 2024-11-29 11-13-16

Verify User's Home Directory

Screenshot from 2024-11-29 11-17-15

Delete User

Screenshot from 2024-11-29 11-19-30

Create User Again

useradd oggy cat /etc/passwd

Screenshot from 2024-11-29 11-21-52

Explanation of fields: oggy: Username X: Password placeholder 1001: User ID (UID) 1001: Group ID (GID) home/oggy: Home directory bin/bash: Default shell

Change Username

Screenshot from 2024-11-29 11-23-48

cat /etc/passwd

Screenshot from 2024-11-29 11-25-03

Change User ID

Screenshot from 2024-11-29 11-27-20

Screenshot from 2024-11-29 11-27-53

Add Full Name

Screenshot from 2024-11-29 11-29-17

Screenshot from 2024-11-29 11-29-54

Change Home Directory

Screenshot from 2024-11-29 11-34-39

Screenshot from 2024-11-29 11-33-57

cat /etc/passwd

Screenshot from 2024-11-29 11-35-18

Change Shell Location

Screenshot from 2024-11-29 11-36-50

Screenshot from 2024-11-29 11-38-03

Again change / to /bin/bash

Screenshot from 2024-11-29 11-39-20

Set Password

Screenshot from 2024-11-29 11-40-26

Login and Check Password File

  • login as varun

Screenshot from 2024-11-29 11-42-15

when we login as user, '#' is chanage into '$'

Screenshot from 2024-11-29 11-44-13

'su' cammand use return to root

  • password file are present in cat /etc/shadow

Screenshot from 2024-11-29 11-49-06

Fields explained:

Screenshot from 2024-11-29 11-48-06

Manage Password Settings

Screenshot from 2024-11-29 11-53-42

  • chage -E "2024-09-23" varun for account expire
  • chage -I 3 varun for password inactive

5) Group Management

Add Group

Screenshot from 2024-11-29 13-07-52

Screenshot from 2024-11-29 13-10-28

Screenshot from 2024-11-29 13-11-28

Delete Group

Screenshot from 2024-11-29 13-15-51

Modify Group ID

Screenshot from 2024-11-29 13-12-41

Screenshot from 2024-11-29 13-12-59

Change User's Primary Group

Screenshot from 2024-11-29 13-18-18

Screenshot from 2024-11-29 13-18-33

Screenshot from 2024-11-29 13-20-36

Add User to Additional Groups

Screenshot from 2024-11-29 13-26-22

Screenshot from 2024-11-29 13-28-15

Remove User from Group

Screenshot from 2024-11-29 13-29-21

Add Multiple Users to a Group

Screenshot from 2024-11-29 13-33-43

Check Group Members

Screenshot from 2024-11-29 13-34-51

Add User to Multiple Groups

Screenshot from 2024-11-29 13-36-54

Change Group Name

Screenshot from 2024-11-29 13-38-42

6) Assign Permissions for User Management

Screenshot from 2024-11-29 13-41-02

Screenshot from 2024-11-29 13-43-02

Screenshot from 2024-11-29 13-44-20

File to Edit: /etc/sudoers

Add the line to grant varun privileges: varun ALL=(ALL) ALL

Screenshot from 2024-11-29 13-46-00

About

Comprehensive guide for managing pipe,search words, users, groups, and permissions on Linux, with practical examples and screenshots.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors