• About
  • Advertise
  • Privacy & Policy
  • Contact
Friday, January 9, 2026
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home AI News

Need to modify user accounts in Linux? This is the command for you

AiNEWS2025 by AiNEWS2025
2025-09-16
in AI News
0
Need to modify user accounts in Linux? This is the command for you
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


gettyimages-1394117981-1

Trevor Williams/DigitalVision via Getty

Follow ZDNET: Add us as a preferred source on Google.


The usermod command is short for user modification, and, as the name implies, allows you to modify various aspects of a user account. 

For a Linux administrator, this command is crucial. For Linux users, the command most certainly comes in handy, especially given what it can do.

Let’s dive down this rabbit hole and see what’s what with the Linux usermod command.

1. Change user details

When you create a Linux user with the adduser command, you can include certain details to go along with the new user (such as full name, office and home phone numbers, and other information, which can be used as a description. After you’ve created the user, the only way to change or add such information is via the usermod command. Say, for instance, you want to add a comment for a user. To do that, you would issue the command:

sudo usermod -c “INFORMATION” USER

Also: 5 surprisingly productive things you can do with the Linux terminal

Where INFORMATION is what you want to add, and USER is the user account you want to change.

This can be handy if you have two users with the same first name and you want to differentiate them in their user information. 

2. Change a username

You can also change a username. Before you do this, know that it does not change the user’s home directory name. So if I have the user sam and I want to change it to samantha, usermod is there to help me. Such a command would look like this:

sudo usermod -l samantha sam

The -l option is for the login name.

3. Rename a home directory

After you change a username, you might also want to rename the user’s home directory. Before you do this, you must ensure that the user is logged out; otherwise, it could wreak havoc on their account (or their data). You also need to make sure that the user’s data is added to the new home directory (otherwise, the user winds up with an empty home). To change a directory name (and add the data), you would use a command like this (sticking with our sam/samantha example):

sudo usermod -d /home/samantha -m sam

The -d option sets the new home directory path, and the -m option moves the data.

Also: There’s a new coolest Linux distribution ready to wow you 

4. Lock and unlock a user’s account

There may be times when you need to lock a user out of their account (and later allow them back in). This could be used for temporary employees or grounded children. To lock a user account, the command would be:

sudo usermod -L USER

Where USER is the username to which the lock applies.

To unlock the account, you would issue the command:

sudo usermod -U USER

Where USER is the user account.

6. Change a user’s account expiry date

Did you know you can expire a user account in Linux? Let’s say you have a temp employee whose contract ends on October 31, 2025. If you want to set the person’s user account to expire on that date (instead of having to remember it when the date arrives), you can use the expiry feature of usermod like so:

sudo usermod -e 2025-10-31 USER

Where USER is the user account name.

7. Add a user to a group (or groups)

I’ve had to use this feature so many times. For example, I use Docker a lot, and when I install it, I have to add users to the group (otherwise it won’t work for them without using sudo, which can lead to security issues). You might have also created a group that will be used by several accounts to access a specific folder. Let’s say you’ve created the editorial group and want to add sam to it. The command for that would be:

sudo usermod -aG editorial sam

Also: 7 Linux terminal basics every beginner should learn first – and why

8. Modify a user’s home directory

If you’ve renamed a user account, you’ll notice their home directory is still listed as the original username. If you would like to rename the user’s home directory (to avoid confusion), usermod has your back. Before you do this, however, it’s important that you make sure the user is logged out of their account (otherwise, it could cause serious problems).

To change the name of a user’s home directory, the command would be:

sudo usermod -d /home/NEWNAME OLDNAME

Where NEWNAME is the new name for the directory and OLDNAME is the current name.

9. Change a user’s shell

Chances are pretty slim that you’ll ever need to do this, but you can change a user’s shell. Let’s say you want to change samantha’s shell from bash to zsh. To do that, you should first make sure the new shell is actually installed with the command:

cat /etc/shells

If zsh is listed, you can change it for samantha with the following command:

sudo usermod -s /bin/SHELL samantha

Want to follow my work? Add ZDNET as a trusted source on Google.



Source link

#modify #user #accounts #Linux #command

Previous Post

What The Big Beautiful Bill Means For Founders

Next Post

How AI Is Upending Politics, Tech, the Media, and More

AiNEWS2025

AiNEWS2025

Next Post
How AI Is Upending Politics, Tech, the Media, and More

How AI Is Upending Politics, Tech, the Media, and More

Stay Connected test

  • 23.9k Followers
  • 99 Subscribers
  • Trending
  • Comments
  • Latest
A tiny new open source AI model performs as well as powerful big ones

A tiny new open source AI model performs as well as powerful big ones

0
Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

0
Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

0
Best Headphones for Working Out (2024): Bose, Shokz, JLab

Best Headphones for Working Out (2024): Bose, Shokz, JLab

0
Aumovio turns to the cloud to scale autonomous vehicle testing

Aumovio turns to the cloud to scale autonomous vehicle testing

2026-01-09
Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

2026-01-09
A new CRISPR startup is betting regulators will ease up on gene-editing

A new CRISPR startup is betting regulators will ease up on gene-editing

2026-01-09
How LLMs Handle Infinite Context With Finite Memory

How LLMs Handle Infinite Context With Finite Memory

2026-01-09

Recent News

Aumovio turns to the cloud to scale autonomous vehicle testing

Aumovio turns to the cloud to scale autonomous vehicle testing

2026-01-09
Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

2026-01-09
A new CRISPR startup is betting regulators will ease up on gene-editing

A new CRISPR startup is betting regulators will ease up on gene-editing

2026-01-09
How LLMs Handle Infinite Context With Finite Memory

How LLMs Handle Infinite Context With Finite Memory

2026-01-09
Footer logo

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow Us

Browse by Category

  • AI & Cloud Computing
  • AI & Cybersecurity
  • AI & Sentiment Analysis
  • AI Applications
  • AI Ethics
  • AI Future Predictions
  • AI in Education
  • AI in Fintech
  • AI in Gaming
  • AI in Healthcare
  • AI in Startups
  • AI Innovations
  • AI News
  • AI Research
  • AI Tools & Automation
  • Apps
  • AR/VR & AI
  • Business
  • Deep Learning
  • Emerging Technologies
  • Entertainment
  • Fashion
  • Food
  • Gadget
  • Gaming
  • Health
  • Lifestyle
  • Machine Learning
  • Mobile
  • Movie
  • Music
  • News
  • Politics
  • Review
  • Robotics & Smart Systems
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

Aumovio turns to the cloud to scale autonomous vehicle testing

Aumovio turns to the cloud to scale autonomous vehicle testing

2026-01-09
Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

Robot Talk Episode 139 – Advanced robot hearing, with Christine Evers

2026-01-09
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.