`
FansUnion
  • 浏览: 154777 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Linux帐号管理[中]--用户管理

 
阅读更多

摘要:本文简要介绍了Linux帐号管理的用户管理。

Linux: Ubuntu10.0.4

1.系统管理员功能

1.1新建用户:useradd

Usage: useradd [options]

Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
-f, --inactive INACTIVE password inactivity period of the new account
-g, --gid GROUP name or ID of the primary group of the new
account
-G, --groups GROUPS list of supplementary groups of the new
account
-h, --help display this help message and exit
-k, --skel SKEL_DIR use this alternative skeleton directory
-K, --key KEY=VALUE override /etc/login.defs defaults
-l, --no-log-init do not add the user to the lastlog and
faillog databases
-m, --create-home create the user's home directory
-M, --no-create-home do not create the user's home directory
-N, --no-user-group do not create a group with the same name as
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping

1.2修改用户:usermod

Usage: usermod [options]

Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-g, --gid GROUP force use GROUP as new primary group
-G, --groups GROUPS new list of supplementary GROUPS
-a, --append append the user to the supplemental GROUPS
mentioned by the -G option without removing
him/her from other groups
-h, --help display this help message and exit
-l, --login NEW_LOGIN new value of the login name
-L, --lock lock the user account
-m, --move-home move contents of the home directory to the
new location (use only with -d)
-o, --non-unique allow using duplicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new password
-s, --shell SHELL new login shell for the user account
-u, --uid UID new UID for the user account
-U, --unlock unlock the user account
-Z, --selinux-user new SELinux user mapping for the user account

1.3删除用户:userdel

Usage: userdel [options]

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

1.4设置密码:passwd

1.5详细密码设置:chage

Usage: chage [options] [LOGIN]

Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS

2.普通用户功能

2.1finger
Login Name Tty Idle Login Time Office Office Phone
fans fans tty7 6:22 Jun 21 09:40 (:0)
fans fans pts/0 Jun 21 15:54 (:0.0)
2.2chfn

2.3chsh

2.4id

uid=1000(fans) gid=1000(fans) 组=4(adm),20(dialout),21(fax),24(cdrom),25(floppy),26(tape),30(dip),44(video),46(plugdev),104(fuse),105(lpadmin),119(admin),121(nopasswdlogin),122(sambashare),1000(fans)

分享到:
评论

相关推荐

    linux文件系统管理-权限管理(基础权限设置实验)

    实验目的 1、掌握Linux文件系统权限的设置 2、掌握linux用户帐号与组管理 3、掌握linux 文件共享的设置方法 4、掌握linux 文件共享的权限设置方法

    Linux运维-运维课程下用户组管理11-更改用户的账号信息(下).mp4

    Linux运维-运维课程下用户组管理11-更改用户的账号信息(下).mp4

    Linux运维-运维课程下用户组管理10-更改用户的账号信息(上).mp4

    Linux运维-运维课程下用户组管理10-更改用户的账号信息(上).mp4

    Linux-C编写的个人帐号管理软件

    本软件是以学习研究为目的而开发的一款运行在Linux系统环境下的帐号密码管理软件,该软件功能简洁实用、安全小巧。通过该软件用户可将日常的一些网站、交友等不便于管理的帐号密码数据集中管理并加密保存。 2.基本...

    linux实验 用户管理和进程管理

    1、创建1个用户登录脚本的模板,命名为/etc/skel-net,在skel-net中创建一文件名为“网络用户须知”,创建用户net09用skel-net的模板,创建完毕到这该用户家目录中检查是否有“网络用户须知”文件。 2、先设置当前...

    linux用户管理命令

    linux用户管理 Linux Linux命令 Linux管理 Linux用户 账号管理 组管理 用户管理

    linux用户和组权限管理

    linux用户和组权限管理 1.用户文件/etc/passwd 2.密码文件/etc/shadow * 现在用户的密码都是加密保存在这个文件里了,需要管理员权限才能打开,不再保存在passwd里。

    linux项目工程资料-基于Linux命令行的账号密码管理软件.zip

    可定制性:由于Linux的源代码是公开的,用户可以根据自己的需求进行定制和修改。这使得Linux成为了一种非常适合企业级应用的操作系统,可以根据企业的特定需求进行定制和优化。 安全性:Linux操作系统在安全性方面...

    linux用户创建

     用户管理的一项重要内容是用户口令的管理。用户账号刚创建时没有口令,但是被系统锁定,无法使用,必须为其指定口令后才可以使用,即使是指定空口令。  指定和修改用户口令的Shell命令是passwd。超级用户可以为...

    linux十二章-虚拟用户访问ftp.mp4

    1. 建立虚拟FTP用户的帐号数据库文件用到db_load工具先安装软件包 rpm -ivh libdb-utils-5.3.21-19.el7.x86_64.rpm (默认已安装) 2. db_load -T -t hash -f vusers.list vusers.db 通db_load工具创建出Berkeley DB...

    Linux 用户和组管理

    详细介绍Linux 用户和组管理,最全的有关ftp的命令。

    Linux服务器配置与管理项目9--邮件服务器配置与管理.pptx

    Linux服务器配置与管理项目9 邮件服务器配置与管理 Linux服务器配置与管理项目9--邮件服务器配置与管理全文共54页,当前为第1页。 【项目描述】 公司为方便内部信息的交流,需要一台邮件服务器实现公司内部员工的...

    Linux应用技术:Linux用户组管理.pptx

    项目4 管理用户和用户组;第四讲 主要内容;Linux用户组;Linux用户与组;举例 添加用户aa,不指定属组。 结论:aa属于私有组,aa组是aa用户的主组。 添加用户bb,指定属于aa组,使aa组成...使用Linux图形化工具管理用户和组

    linux操作系统教程 linux系统操作教程 linux培训资料PPT课件 第08章用户帐号管理 共24页.ppt

    linux操作系统教程 linux系统操作教程 linux培训资料PPT课件 第08章用户帐号管理 共24页.ppt

    Linux环境数据库管理员指南

    第8章 在Linux上安装和管理Progress 218 8.1 引言 218 8.2 安装 218 8.2.1 从介质中安装 219 8.2.2 核心参数 223 8.2.3 环境设置 225 8.3 配置 226 8.3.1 目录结构 227 8.3.2 磁盘空间与 I/O 吞吐量 227 8.3.3 创建...

    7 Linux用户账号与组账号管理.zip

    7 Linux用户账号与组账号管理

    第6章 Linux用户管理

    6.1 用户管理 一、登入linux的顺序 在输入密码之后 1.先查找/etc/passwd中是否有这个账号,若没有则跳出,若有则将该账号对应的uid与gid读出,另外该账号的根目录与shell设定也一并读出。 2.核对密码表,这是linux会...

    实验四 Linux用户和组的管理

    添加一个用户,账号为姓名,初始口令为123456; 要求该用户的主目录为/home/share; 要求该用户的基本组为root; 要求该用户的shell为/bin/sh; 要求把该用户加到mail组和news组中。

    Linux服务器配置与管理:linux用户管理命令.pptx

    掌握: 用户管理命令 【能力目标】 能使用命令管理用户 【思政目标】 培养学生职业素养和工匠精神。 常用选项: -c 注释信息——设定与用户相关的说明信息(如,真实姓名、邮箱地址等)。 -d 目录——设定用户的家目录...

    Linux下的内存管理

    本书共分三篇23章,分别介绍了Linux的基本知识、文本编辑工具、用户账号与组管理、文件与目录系统、用户界面——shell、多任务与进程、启动程序与关机、扩充系统、网络应用与设置、Linux系统的视窗环境———X ...

Global site tag (gtag.js) - Google Analytics