免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1331 | 回复: 0
打印 上一主题 下一主题

adduser问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-12-14 18:14 |只看该作者 |倒序浏览

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


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/2496/showart_8026.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP