usermod
Please demontrate 10 examples of using the usermod command on a Fedora GNU/Linux computer system.
Certainly! Here are 10 examples of using the usermod command on a Fedora GNU/Linux system:
Add a user to an additional group:
usermod -aG groupname usernameChange a user's login shell:
usermod -s /bin/bash usernameLock a user's account (disable login):
usermod -L usernameUnlock a previously locked user account:
usermod -U usernameSet the expiration date for a user account:
usermod -e YYYY-MM-DD usernameAdd a specific home directory for a user:
usermod -d /path/to/new/home usernameChange a user's primary group:
usermod -g groupname usernameRestrict a user's login shell to a specific command:
usermod -s /sbin/nologin usernameSet a user's password to expire and force them to change it on next login:
usermod -e 0 usernameChange a user's username:
usermod -l newusername username
Remember to replace "groupname," "username," and "/path/to/new/home" with actual values relevant to your system. Additionally, exercise caution when modifying user accounts to avoid unintended consequences.
