adduser问题
发表于:2007-06-09来源:作者:点击数:
标签:
http://www.chinaunix.net/jh/5/16323.html 我在创建用户时遇到这样的一个问题,请那位大侠指点!!!下面是我做的步骤请问这样做对不对。 dell2650b#adduser Useoption``-silent''ifyoudon'tw ant toseeallwarningsandquestions. Check/etc/shells Shell:/us
http://www.chinaunix.net/jh/5/16323.html
我在创建用户时遇到这样的一个问题,请那位大侠指点!!!下面是我做的步骤请问这样做对不对。 dell2650b# adduser Use option ``-silent'' if you don't want to see all warnings and questions.
Check /etc/shells Shell: /usr/local/bin/bash not executable! Check /etc/master.passwd Check /etc/group User ``/wheel/tony'' has gid 1002 but a group with this gid does not exist. Usernames must match regular expression: [lydong]: Enter your default shell: csh date no sh tcsh [tcsh]: Your default shell is: tcsh -> /bin/tcsh Enter your default HOME partition: [/home/lydong]: Create /home/lydong Copy dotfiles from: /usr/share/skel no [/usr/share/skel]: Send message from file: /etc/adduser.message no y [y]: n Use passwords (y/n) [y]: y
Write your changes to /etc/adduser.conf? (y/n) [n]: y
Ok, let's go. Don't worry about mistakes. I will give you the chance later to correct any input. Enter username [lydong]: luoyaodong Username doesn't match the regexp /lydong/ Enter username [lydong]: lydong Please enter a username Enter username [lydong]: oeheonse Username doesn't match the regexp /lydong/ Enter username [lydong]: ^C
|
|
【发表回复】【查看CU论坛原帖】【关闭】 |
夜猫子 回复于:2002-11-13 18:05:25 | 在adduser.conf里usernameregexp指定了用来验证新用户名是否合乎规范的正则表达式,你可以修改这个值来强制用户名符合你的规定。 默认的情况下应该是: usernameregexp = '^[a-z0-9_][a-z0-9_-]*$' 这是说用户名必须以a-z、0-9以及'_'开头,后边可以跟多个a-z、0-9、'_'、'-'字符,当你加新用户的时候,adduser就会拿这个正则表达式来效验你的用户名是否规范。
看了你输出结果: Usernames must match regular expression: [lydong]: 这说明你把正则表达式给设置成了lydong,后边应用这个正则表达式来效验你的新用户名自然是通不过了(除非你输入lydong)。
修改也很简单,修改为usernameregexp = '^[a-z0-9_][a-z0-9_-]*$'就可以了。
| shenvo 回复于:2002-11-13 18:08:40 | 删除/etc/adduser.conf
重建用户时前面的变量设定建议你采用默认值
| zhangluoer 回复于:2003-08-17 10:48:35 | 很经典!
| AutoSPy 回复于:2003-08-20 17:28:44 | #pw useradd <参数>
|
|
原文转自:http://www.ltesting.net