QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1863|回复: 5

请教:把用户添加到新组的一系列问题

[复制链接]
发表于 2006-6-15 17:47:18 | 显示全部楼层 |阅读模式
我先用root账号建立一个用户sinb,
然后登陆sinb账户,但是其默认的组是sinb,为了更改组名,我输入命令:
$newgrp sinbgrp,
$groups sinb(查找其组名)
sinb: sinb sinbgrp(显示有两个组)
但是其默认的第一组名是sinb,请问怎么更改?



后来决定删了用useradd -g 命令来达到目的,于是
#userdel sinb
但是去home目录下,仍有sinb文件夹,
大怒之下,
#rm –rf sinb,
删除完毕,为了测试是否删除干净(home 下已无文件夹)
我用root账号重新建立一个用户sinb,
#useradd sinb
#passwd  sinb
new password: …….
Retype: ……
重启后进入sinb账号,显示:
error: 这段话我忘记啦
然后进入桌面是全黑色,只能看到回收站和我的电脑,其他窗口也看不见。请教大虾为什么会这样呢?

极其郁闷中,我重装了linux, fedora core 5,
设置了普通用户sinb,然后
$groupadd sinbgrp
bash: groupadd: command not found
但是我用man 查:
$man groupadd
就能查到,
为什么不能添加新组呢〉?求救!!!!!
    
 楼主| 发表于 2006-6-15 20:23:36 | 显示全部楼层
本菜鸟再一次重装,在安装过程中间把server勾上,结果再次登陆root的时候能用
groupadd命令,而其他普通用户则不能。
问题基本解决,原因相当不明朗,:(
回复

使用道具 举报

 楼主| 发表于 2006-6-15 20:23:52 | 显示全部楼层
本菜鸟再一次重装,在安装过程中间把server勾上,结果再次登陆root的时候能用
groupadd命令,而其他普通用户则不能。
问题基本解决,原因相当不明朗,:(
回复

使用道具 举报

发表于 2006-6-16 10:21:05 | 显示全部楼层
这与环境变量PATH有关,看看你的groupadd在哪里可以用
[code:1]which groupadd[/code:1]
然后看看PATH里面包含该目录吗:
[code:1]echo $PATH[/code:1]
回复

使用道具 举报

 楼主| 发表于 2006-6-16 15:39:25 | 显示全部楼层
版主, thank you very much. Sorry I could't type in chinese now.
I inserted the comand you told me,  but I don't  know its meaning. Could you explain it, OK? 3Q

[flacs@localhost ~]$ man which
[flacs@localhost ~]$ which groupadd
/usr/bin/which: no groupadd in (/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/flacs/bin)
[flacs@localhost ~]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/flacs/bin
回复

使用道具 举报

发表于 2006-6-17 00:52:42 | 显示全部楼层
[code:1]
[flacs@localhost ~]$ which groupadd
/usr/bin/which: no groupadd in (/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/flacs/bin)
[/code:1]
means that you have no groupadd in the PATH which contain the directory searching the command you type, so I think you need to find where "which" command is and reset the variable "PATH" to add the path including your "which" command by adding the following line in your $HOME/.bashrc:
[code:1]
export PATH=$PATH:/path/to/which
[/code:1]
and then execute
[code:1]
. ~/.bashrc
[/code:1]
have a try and good luck!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-30 08:45 , Processed in 0.042332 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表