User Tools

Site Tools


commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
commands [2025/01/12 10:14] 1211112319commands [2025/01/17 16:54] (current) 1211112319
Line 1: Line 1:
 +
 ====== How to create and delete users ====== ====== How to create and delete users ======
  
Line 25: Line 26:
 **//EXTRA//**\\ **//EXTRA//**\\
  Add user //aidel// to sudo group\\  Add user //aidel// to sudo group\\
 +  * use **//sudo adduser username sudo//**
 +
 +
  
 {{:whatsapp_image_2025-01-12_at_13.28.50_2303cca1.jpg?400|}} {{:whatsapp_image_2025-01-12_at_13.28.50_2303cca1.jpg?400|}}
Line 78: Line 82:
  
 {{:whatsapp_image_2025-01-12_at_13.19.59_ab381a49.jpg?400|}} {{:whatsapp_image_2025-01-12_at_13.19.59_ab381a49.jpg?400|}}
 +
 +  * Delete User and Home Directory
 +**-r**: Recursively removes the user’s home directory and mail spool.
 + 
 +
 +{{:screenshot_2025-01-12_191951.png?400|}}
 +
 +  *  Force Deletion
 +**-f**: Forces the removal of the user account, kills processes, and deletes files.
 +
 +{{:screenshot_2025-01-12_192405.png?400|}}
 +
 +  * Lock User Before Deleting
 +Locks the user's account before deletion to ensure no one logs in during the process.
 +
 +
 +**//EXTRA//**
 +
 + {{:screenshot_2025-01-12_193134.png?400|}}
 +
 +
 +
 +
 +
 +====== User Management ======
 +
 +User management in Linux is a critical aspect of system administration. It involves creating, modifying, and managing user accounts and groups to ensure proper access control, system security, and resource allocation. Each user is assigned a unique identity, along with permissions and restrictions.
 +
 +  * **Change user password**
 +
 +  - login to any sudoer group user or root
 +  - Use **//sudo passwd username//** to change user password
 +  - Enter new password then you will be ask to retype you new password
 +  - Password change
 +  - 
 +
 +{{:screenshot_2025-01-16_144702.png?400|}}
 +
 +
 +  * **Manage Password aging and expiration**
 +
 +The **sudo chage** command is used in Linux to manage password aging and expiration policies for a user. It allows administrators to define and control how long a user's password remains valid, enforce password expiration, and specify warnings before password expiration.
 +
 +  - //**sudo chage [option] username**//
 +
 +  * **sudo chage -l username**
 +Display the current password aging information
 +
 +
 +{{:screenshot_2025-01-16_162659.png?400|}}
 +
 +  * **sudo chage -E  2025-12-31 username**
 +Set the account expiration date. The account will be disabled after this date.
 +To set account expiration to never use **sudo change -E -1 username**
 +
 +
 +{{:date.png?400|}}
 +
 +  * **sudo chage -W 7 username**
 +The user will receive a warning 7 days before the password expires.
 +
 +{{:date.png?400|}}
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
commands.1736676862.txt.gz · Last modified: 2025/01/12 10:14 by 1211112319

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki