1、手动添加用户hive,基本组hive(5000),附加组为mygroup
[root@Ourlab ~]# nano /etc/passwd
hive:x:5000:5000:Hive:/home/hive:/bin/bash
[root@Ourlab ~]# nano /etc/group
mygroup:x:4006:hive
hive:x:5000:
[root@Ourlab ~]# date +%s
1491321056
[root@Ourlab ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1491321056/86400
17260
[root@Ourlab ~]# openssl passwd -1 -salt '123456789'
Password:
$1$12345678$UlXDpHTkznPWJJdUBNVIB0
[root@Ourlab ~]# nano /etc/shadow
hive:$1$12345678$UlXDpHTkznPWJJdUBNVIB0:17260:0:99999:7:::
[root@Ourlab ~]# cp -r /etc/skel /home/hive
备注:
openssl passwd:手动添加密码
-1:使用MD5加密
-salt:为密码添加杂质
阅读(1030) | 评论(0) | 转发(0) |