Chinaunix首页 | 论坛 | 博客
  • 博客访问: 338875
  • 博文数量: 222
  • 博客积分: 9349
  • 博客等级: 中将
  • 技术积分: 2135
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-07 13:45
文章分类

全部博文(222)

文章存档

2010年(222)

分类: LINUX

2010-08-08 10:29:43

转载本站文章请注明,作者:
本文连接

[jean@jeantoe ~]$ pwd
/home/test
[jean@jeantoe ~]$ touch abc
[jean@jeantoe ~]$ ll
total 0
-rw-rw-r-- 1 jean jean 0 2009-12-13 21:48 abc

实现方法

# vipw

test:*:500:500::/home/test:/bin/bash

原理解释

uid是不能重复,但是可以多个账户共用一个uid (不违反uid的唯一性)但是身份仅仅是第一个使用uid的那个账户身份

也可以使用useradd来完成。

useradd -o

-o, --non-unique
Allow the creation of a user account with a duplicate (non-unique)
UID.

如何揪出重复UID的用户。我在这里只考虑了有一组UID重复的情况,实际情况复杂时还要作一些调整。

[root@jeantoe mysqla]# grep `awk -F: '{print $3}' /etc/passwd | uniq -c | sort -r | sed '1p;d' | awk '{print $2}'` /etc/passwd

阅读(1710) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~