LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 994|回复: 9

Slackware怎么添加普通用户并分配用户主目录

[复制链接]
发表于 2004-9-26 02:15:29 | 显示全部楼层 |阅读模式
如题
发表于 2004-9-26 05:02:30 | 显示全部楼层
#adduser
 楼主| 发表于 2004-9-26 11:27:05 | 显示全部楼层
这样的话普通用户似乎是没有分配主目录的啊
发表于 2004-9-28 15:50:57 | 显示全部楼层
adduser肯定可以,你是不是误用了useradd?
发表于 2004-9-30 13:40:41 | 显示全部楼层
# useradd  username -m -G users,wheel,audio,tty,games -s /bin/bash
发表于 2004-9-30 13:48:20 | 显示全部楼层
useradd
-m 代表修改的意思,第一次创建用户不用这个
-g 代表用户属于哪个组
-s 代表用户目录

以上是我个人的理解,还望大家指点
发表于 2004-9-30 16:07:42 | 显示全部楼层

奇怪。

我用adduser为什么就不行呢。
我开始用这个命令加了一个cio用户。提示让我输入GROUP 我回车,还有三个提示,什么目录,SHELL什么的。一路回车。提示有这个用户了。
然后我用userdel ? 好像是。我删除了用户。
当我还用adduser cio 这个用户的时候就无论如何也建不成功了。头大。建别的用户却可以。
发表于 2004-9-30 19:14:27 | 显示全部楼层
最初由 babo 发表
useradd
-m 代表修改的意思,第一次创建用户不用这个
-g 代表用户属于哪个组
-s 代表用户目录

以上是我个人的理解,还望大家指点

你的理解不完全正确,这是man useradd的有关说明:
  1. -m     The user's home directory will be created if it does not exist. The files contained in
  2.               skeleton_dir will be copied to the home directory if the -k option is used,  otherwise
  3.               the  files  contained  in /etc/skel will be used instead. Any directories contained in
  4.               skeleton_dir or /etc/skel will be created in the user's home directory as well. The -k
  5.               option  is  only valid in conjunction with the -m option. The default is to not create
  6.               the directory and to not copy any files.
  7. -g initial_group
  8.               The group name or number of the user's initial login group. The group name must exist.
  9.               A  group number must refer to an already existing group. The default group number is 1
  10.               or whatever is specified in /etc/default/useradd.

  11. -s shell
  12.               The  name  of  the user's login shell. The default is to leave this field blank, which
  13.               causes the system to select the default login shell.
复制代码
发表于 2004-10-9 10:44:41 | 显示全部楼层
adduser不是很方便吗?提示存在用户,可能是你用其他方法加过用户了,换个名字试试!一路回车,就会生成xxx.users,xxx是你的用户名
发表于 2004-10-9 10:45:45 | 显示全部楼层
实在不行,装个dropline-gnome,有图形界面的用户管理
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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