手动添加用户步骤

1187阅读 1评论2009-10-09 www_xylove
分类:LINUX

摘录自鸟哥的文档,可以尝试一下不使用useradd的方式添加一个用户:
如下:
       6. 更改家目录属性 ( chown -R account.group /home/account

建立新的群组 test ,设其 GID 520
[root @test /root ]# vi /etc/group
----
test:x:520:test               <==新增群组,且群组的人为 test GID 520

建立 test 的各个属性
[root @test /root ]# vi /etc/passwd
----
test:x:520:520:testing account:/home/test:/bin/bash   <==建立各个属性

同步化 /etc/passwd /etc/shadow

 
 
 
 

建立新的群组 test ,设其 GID 520
[root @test /root ]# vi /etc/group
----
test:x:520:test               <==新增群组,且群组的人为 test GID 520

建立 test 的各个属性
[root @test /root ]# vi /etc/passwd
----
test:x:520:520:testing account:/home/test:/bin/bash   <==建立各个属性

同步化 /etc/passwd /etc/shadow
[root @test /root ]# pwconv         <== passwd 的资料转入 /etc/shadow 中!

建立密码
[root @test /root ]# passwd test    <==建立使用者 test 密码
Changing password for user test
New password:
Retype new password:
passwd: all authentication tokens updated successfully

建立家目录并转化家目录的拥有者
[root @test /root ]# cp -r /etc/skel /home/test
[root @test /root ]# chown -R test:test /home/test

 
OK。
 
上一篇:ORACLE的索引和约束详解
下一篇:正则表达式基础知识

文章评论