![centos 创建新用户](https://i-blog.csdnimg.cn/blog_migrate/241cb5f160e4970ac0d9d0c6993b7ebd.png)
centos 创建新用户
CentOS is enterprise level Linux distribution which is clone of the RedHat. User management like create, add, remove etc is important part of the daily Administration tasks. In this tutorial we will look how to add new user to the CentOS system.
CentOS是企业级Linux发行版,是RedHat的克隆。 用户管理(例如创建,添加,删除等)是日常管理任务的重要组成部分。 在本教程中,我们将研究如何将新用户添加到CentOS系统。
列出当前用户 (List Current Users)
Before creating new user we will list existing users. We can use different methods to list existing users but following is the most practical way to list existing users. We will cat user names with the cut
command.
在创建新用户之前,我们将列出现有用户。 我们可以使用不同的方法来列出现有用户,但是以下是列出现有用户的最实用方法。 我们将使用cut
命令来管理用户名。
$ cut -f 1 -d : /etc/passwd
![List Current Users](https://i-blog.csdnimg.cn/blog_migrate/82470b4893a77259bf353106ce91013d.png)
使用useradd添加新用户(Add New User with useradd)
Now we can add our new user. We have all ready checked the existing users but if we try to add existing user we will files. We will use useradd
command by providing the user name. In this example the user name will be poftut
.
现在,我们可以添加新用户。 我们已经准备好检查现有用户,但是如果我们尝试添加现有用户,我们将归档。 我们将通过提供用户名来使用useradd
命令。 在此示例中,