Linux下创建用户组报错;不能进去oracle

[root@rac1 ~]# id oracle
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>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值