ubuntu中添加了新用户的后续操作—用户管理二
来源:互联网 发布:unity3d培训机构那个好 编辑:程序博客网 时间:2024/06/07 21:41
ubuntu中useradd和adduser究竟怎么用—用户管理一中,俺们晓得了在ubuntu中使用useradd和adduser还真是有点区别的,那现在我们又提出了一些新闻:1、如何改新用户添加密码或者更改密码呢?2、如何删除新用户呢,当然这个删除是需用连新用户主目录一起删除掉的。
我们来解决问题2,删除新用户及其主目录。为什么选择这个呢,因为这个比较容易点,话说大家都喜欢挑简单点的东西使用或者学习,譬如下片儿,有人上cl,有人却选择使用迅雷邻居,殊不知后者较前者要容易得多哇~~
删除操作和添加操作我们配套起来说,这样方便我自己记忆,也方便他人使用和学习。
使用adduser添加用户的话,那我们就使用deluser删除用户,看下帮助同志的信息:
walfred@ubuntu:/home$ deluser -h
deluser USER
remove a normal user from the system
example: deluser mike
--remove-home remove the users home directory and mail spool
--remove-all-files remove all files owned by user
--backup backup files before removing.
--backup-to <DIR> target directory for the backups.
Default is the current directory.
--system only remove if system user
delgroup GROUP
deluser --group GROUP
remove a group from the system
example: deluser --group students
--system only remove if system group
--only-if-empty only remove if no members left
deluser USER GROUP
remove the user from a group
example: deluser mike students
general options:
--quiet | -q don't give process information to stdout
--help | -h usage message
--version | -v version number and copyright
--conf | -c FILE use FILE as configuration file
原来删除就这么简单:
walfred@ubuntu:/home$ sudo deluser --remove-home newuser
Looking for files to backup/remove ...
Removing files ...
Removing user `newuser' ...
Warning: group `users' has no more members.
Done.
那使用useradd添加用户,我们使用userdel删除用户咯~~
walfred@ubuntu:/home$ userdel -h
Usage: userdel [options] LOGIN
Options:
-f, --force force removal of files,
even if not owned by user
-h, --help display this help message and exit
-r, --remove remove home directory and mail spool
原来这个更简单,原来邻居更简单,哈哈~~
walfred@ubuntu:/home$ sudo userdel -r newuser1
ok,这个介绍完毕,总之用户管理这一块没有什么大的问题,两种方案任君挑选,需要说明的是配套只是为了好记,混用也是可以的,当然还是首选adduser和deluser。
再看1问,在ubuntu中useradd和adduser究竟怎么用—用户管理一我们有个扫尾的问题就是如何一次性使用useradd添加用户、用户主目录及用户管理密码,但是最终在添加密码这一块,好像没有完成,使用的是useradd+passwd的方式才完成了这个任务,使用passwd其实也很简单,只需:
walfred@ubuntu:/home$sudo passwd newuser
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
同样这条命令对已经存在密码的用户一样适用,更改之后就可以正常使用了。
提示:至于有的Linux书籍useradd和adduser以及uerdel和deluser是一码事,他们是符号链接产生的,但walfred在ubuntu上考证并无次说,至少ubuntu是这样的。
返回嵌入式入门专辑目录
- ubuntu中添加了新用户的后续操作—用户管理二
- [Linux学习--用户管理]centos中添加一个新用户,并授权
- ubuntu 16.04下的新用户添加
- linux 添加新用户时常用的操作
- ubuntu添加新用户问题
- Ubuntu下添加新用户
- ubuntu 添加新用户
- ubuntu添加新用户
- Ubuntu添加用户操作
- MYSQL添加新用户 MYSQL为用户创建数据库 MYSQL为新用户分配权限 (二)
- Oracle中添加新用户
- Ubuntu中给mysql添加新用户并分配权限
- Ubuntu 中创建新用户并添加 sudo 权限
- Ubuntu中创建新用户
- Ubuntu服务器配置添加新用户
- Ubuntu 16.04下添加新用户
- MYSQL添加新用户 MYSQL为用户创建数据库 MYSQL为新用户分配权限 无法使用新增的用户登陆mysql
- ubuntu添加新用户并添加公钥
- deb包管理系统及实例讲解apt使用方法
- 如何将二维数组作为函数的参数传递
- ubuntu中useradd和adduser究竟怎么用—用户管理一
- u-boot移植(七)支持nand启动
- Notification详细用法
- ubuntu中添加了新用户的后续操作—用户管理二
- 搭建嵌入式Linux开发环境二
- Notification简介
- 设计模式之我见
- u-boot移植(八)支持yaffs
- 用汇编的眼光看C++ (之x86汇编)
- 获取jsp checkbox 复选框
- 学生、课程、成绩必会的SQL操作
- Notification的参数