Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

Linux: Editing user account with usermod

Posted on February 23, 2021 By rich No Comments on Linux: Editing user account with usermod
Here are all of the switches we can use for usermod followed by some examples of how to use them,
-c = We can add comment field for the useraccount.
-d = To modify the directory for any existing user account.
-e = Using this option we can make the account expiry in specific period.
-g = Change the primary group for a User.
-G = To add a supplementary groups.
-a = To add anyone of the group to a secondary group.
-l = To change the login name
-L = To lock the user account. This will lock the password so we can’t use the account.
-m = moving the contents of the home directory from existing home dir to new dir.
-p = To Use un-encrypted password for the new password. (NOT Secured).
-s = Create a Specified shell for new accounts.
-u = Used to Assigned UID for the user account between 0 to 999.
-U = To unlock the user accounts. This will remove the password lock and allow us to use the user account.
Modify the home directory of a user
usermod -d /home/techshizz
Add a user to additional groups
usermod -G sudo,admins

Unlock a user account
usermod -U rich

Post navigation

❮ Previous Post: How to clear a print queue that won’t clear
Next Post: How to disable SIP ALG on a Draytek router ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown