1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户#passwd tommy //修改密码Changing password for user tommy.New UNIX password: //在这里输入新密码Retype new UNIX password: //再次输入新密码passwd: all authentication tokens updated successfully. 2.赋予r
一.发现问题: 有技术人员离职,需要删除系统帐号,但是进行删除操作的时候报:" userdel: user zhoulijiang is currently used by process 1 " # userdel -r zhoulijiang userdel: user zhoulijiang is currently used by process 二.问题原因: 因为特殊需求,此用户的UID当时修改为0了. # cat /etc/passwd | grep zhoulijian
添加普通用户 [root@server ~]# useradd test //添加一个名为test的用户[root@server ~]# passwd test //修改密码Changing password for user test.New UNIX password: //在这里输入新密码Retype new UNIX password: //再次输入新密码passwd: all authentication tokens updated successfully 赋予root权限 方法一
[root@ok ~]# vim /etc/pam.d/su 下面是/etc/pam.d/su文件的内容 #%PAM-1.0 auth sufficient pam_rootok.so # Uncomment the following line to implicitly trust users in the "wheel" group. #auth sufficient pam_wheel.so trust use_uid # Uncomment the following lin
1.查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 where Id in (select Id from 表 group byId having count(Id) > 1) 2.删除表中多余的重复记录,重复记录是根据单个字段(Id)来判断,只留有rowid最小的记录 DELETE from 表 WHERE (判断字段) IN ( SELECT 判断字段 FROM 表 GROUP BY 判断字段 HAVING COUNT(判断字段) > 1) A
以下sql是a,b两张表通过关联条件id修改a表值,如果b表有重复数据记录,选第一条更新,红色条件为附加限制条件,具体视情况而定: UPDATE a SETname = b.fname,pwd = b.lnameFROM bWHERE a.id = b.id AND a.id in (2,3) 以下sql为查询单表中重复记录: select * from b t1 where t1.fname in (select t2.fname from b t2 group by t2.fname ha