In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people don't understand the knowledge points of this article "How to use Linux usermod command", so Xiaobian summarizes the following contents for everyone, the contents are detailed, the steps are clear, and there is certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "How to use Linux usermod command".
Linux common command usermod command is used to modify the basic information of the user. The usermod command does not allow you to change the name of an online user account.
usermod is used to modify basic information of users
When the usermod command is used to change the user id, make sure that the user is not running any programs on the computer. You need to manually change the user's crontab file. You also need to manually change the user's at profile. To use NIS server, you must change the NIS settings on the server.
syntax usermod(option)(parameter) option-c: modify the user account remarks text; -d: modify the user login directory, only modify the user's home directory configuration information in/etc/passwd, does not automatically create a new home directory, usually used with-m; -m: move the user home directory to a new location, can not be used alone, usually used with-d. -e: modify the validity period of the account; -f: modify the number of days after the password expires to close the account; -g: modify the group to which the user belongs; -G: modify the additional group to which the user belongs; -l: modify the user account name; -L: lock the user password to make the password invalid; -s: modify the shell used by the user after logging in; -u: modify the user ID; -U: unlock the password. Parameter Login Name: Specifies the login name of the user whose information you want to modify.
The instance adds newuser2 to the group staff:
usermod -G staff newuser2 Modify the username of newuser to newuser1:
usermod -l newuser1 newuser locked account newuser1:
usermod -L newuser1 Unlock newuser1:
usermod -U newuser1 Add a user to a user group:
apk add shadow #Install shadow package, usermod command included in usermod usermod -aG group user #Add user to user group-a parameter indicates additional, only used with-G parameter indicates adding user to group.
Modify user home directory:
[root@node-1 ~]# useradd lutixiaya [root@node-1 ~]# ls /home lutixiaya [root @node-1 ~]# usermod -md /data/new_home lutixiaya [root@node-1 ~]# ls /home/ [root@node-1 ~]# ls /data/ new_home The above is the content of this article about "How to use Linux usermod command". I believe everyone has a certain understanding. I hope the content shared by Xiaobian will be helpful to everyone. For more information, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.