uid=1200(oracle) gid=1000(oinstall) groups=1000(oinstall),1200(dba),1201(oper),1300(asmdba)
[root@rac1 ~]# su - oracle
su: warning: cannot change directory to /home/oracle: Permission denied
-bash: /home/oracle/.bash_profile: Permission denied
-bash-3.2$ exit
logout
-bash: /home/oracle/.bash_logout: Permission denied
/home/oracle下正确文件为:
[oracle@rac2 ~]$ ll -a
total 36
drwx------ 3 oracle oinstall 4096 Apr 5 07:03 .
drwxr-xr-x 3 root root 4096 Apr 5 06:28 ..
-rw------- 1 oracle oinstall 192 Apr 5 07:03 .bash_history
-rw-r--r-- 1 oracle oinstall 33 Apr 5 06:28 .bash_logout
-rw-r--r-- 1 oracle oinstall 176 Apr 5 06:28 .bash_profile
-rw-r--r-- 1 oracle oinstall 124 Apr 5 06:28 .bashrc
-rw-r--r-- 1 oracle oinstall 515 Apr 5 06:28 .emacs
drwxr-xr-x 4 oracle oinstall 4096 Apr 5 06:28 .mozilla
有问题的为:
[root@rac1 oracle]# ll -a
total 40
drwx------ 3 500 500 4096 Apr 5 06:59 .
drwxr-xr-x 3 root root 4096 Mar 30 06:23 ..
-rw------- 1 500 500 3317 Apr 5 05:35 .bash_history
-rw-r--r-- 1 500 500 124 Mar 30 06:23 .bashrc
-rw-r--r-- 1 500 500 515 Mar 30 06:23 .emacs
drwxr-xr-x 4 500 500 4096 Mar 30 06:23 .mozilla
-rw------- 1 500 500 8672 Mar 31 02:34 .viminfo
解决方法:
更改属组并且拷贝缺失的文件
[root@rac1 ~]# cp /etc/skel/.bash_profile /home/oracle/
[root@rac1 ~]# cp /etc/skel/.bash_logout /home/oracle/
-------------------------------------------------------------
# /usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
Creating mailbox file: File exists
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
解决方法:rm -rf /var/spool/mail/oracle
重新建
#######################################################
1、建用户: adduser phpq passwd phpq 删用户:userdel peter 2、建工作组: groupadd test 删用户组:groupdel peter 3、新建用户同时增加工作组:useradd -g test phpq //新建phpq用户并增加到test工作组//注:-g所属组-d 家目 -s所用的SHELL 4、给已有的用户增加工作组:usermod -G groupname username 5、修改uid :usermod -u <uid><user> |