useradd -g 1001 -m -d /opt/yuejgw yuejgw useradd:警告:此主目录已经存在,请问如何处理
添加用户,反复添加不上,请大侠们帮忙看一下,具体操作流程如下:
login as: root
root@61.179.27.19's password:
Last failed login: Sun Jun 28 12:39:33 CST 2020 from 85.209.0.100 on ssh:notty
There were 6 failed login attempts since the last successful login.
Last login: Sun Jun 28 11:38:55 2020 from 123.128.22.38
[root@localhost ~]# cd /etc/
[root@localhost etc]# useradd -g 1001 -m -d /opt/yuejgw yuejgw
useradd:用户“yuejgw”已存在
[root@localhost etc]# userdel yuejgw
[root@localhost etc]# useradd -g 1001 -m -d /opt/yuejgw yuejgw
useradd:警告:此主目录已经存在。
不从 skel 目录里向其中复制任何文件。
正在创建信箱文件: 文件已存在
[root@localhost etc]# su - yuejgw
su: 警告:无法更改到 /opt/yuejgw 目录: 权限不够
-bash: /opt/yuejgw/.bash_profile: 权限不够
-bash-4.2$ exit
登出
-bash: /opt/yuejgw/.bash_logout: 权限不够
[root@localhost etc]# su root
[root@localhost etc]# userdel yuejgw
[root@localhost etc]# useradd -g 1001 -m -d /opt/yuejgw /yuejgw
useradd:无效的用户名“/yuejgw”
[root@localhost etc]# useradd -g 1001 -m -d /opt/yuejgw yuejgw
useradd:警告:此主目录已经存在。
不从 skel 目录里向其中复制任何文件。
正在创建信箱文件: 文件已存在
[root@localhost etc]# userdel -rf yuejgw
[root@localhost opt]# cd /etc
[root@localhost etc]# useradd -g 1001 -m -d /opt/yuejgw yuejgw
useradd:警告:此主目录已经存在。
不从 skel 目录里向其中复制任何文件。
[root@localhost etc]# su - yuejgw
su: 警告:无法更改到 /opt/yuejgw 目录: 权限不够
-bash: /opt/yuejgw/.bash_profile: 权限不够
-bash-4.2$ exit
登出
-bash: /opt/yuejgw/.bash_logout: 权限不够
[root@localhost etc]#