CentOS7用户管理

1. 添加用户

[root@centos7 ~]# useradd jack

[root@centos7 ~]# passwd jack

Changing password for user jack.

New password:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

[root@centos7 ~]# exit

2. 切换用户

以新添加的用户登录,然后切换到root账号

login as: jack

jack@192.168.1.101's password:

[jack@centos7 ~]$ su -

Password:

Last login: Fri Oct 27 06:14:50 CST 2017 from 192.168.1.100 on pts/0

[root@centos7 ~]#

3. 将用户作为仅有的可切换到Root的账号

[root@centos7 ~]# usermod -G wheel jack

[root@centos7 ~]# vi /etc/pam.d/su

#%PAM-1.0

auth sufficient pam_rootok.so

# Uncomment the following line to implicitly trust users in the "wheel" group.

#auth sufficient pam_wheel.so trust use_uid

# Uncomment the following line to require a user to be in the "wheel" group.

auth required pam_wheel.so use_uid

auth substack system-auth

auth include postlogin

account sufficient pam_succeed_if.so uid = 0 use_uid quiet

account include system-auth

password include system-auth

session include system-auth

session include postlogin

session optional pam_xauth.so

4. 将发向 root的邮件转到新创建的用户

[root@centos7 ~]# vi /etc/aliases

gdm: root

mailnull: root

postgres: root

sshd: root

smmsp: root

postfix: root

netdump: root

ldap: root

squid: root

ntp: root

mysql: root

desktop: root

rpcuser: root

rpc: root

nfsnobody: root

ingres: root

system: root

toor: root

manager: root

dumper: root

abuse: root

newsadm: news

newsadmin: news

usenet: news

ftpadm: ftp

ftpadmin: ftp

ftp-adm: ftp

ftp-admin: ftp

www: webmaster

webmaster: root

noc: root

security: root

hostmaster: root

info: postmaster

marketing: postmaster

sales: postmaster

support: postmaster

# trap decode to catch security attacks

decode: root

# Person who should get root's mail

#root: marc

root: jack

CentOS7系列--1.3CentOS7用户管理的更多相关文章

  1. CentOS7系列--5.3CentOS7中配置和管理Kubernetes

    CentOS7配置和管理Kubernetes Kubernetes(k8s)是自动化容器操作的开源平台,这些操作包括部署,调度和节点集群间扩展.如果你曾经用过Docker容器技术部署容器,那么可以将D ...

  2. centos7系列-给普通用户sudo权限

    对于linux用户来讲,普通用户的权限是有一定限制的,所以在有些操作的时候,是需要sudo权限的,那么如何在linux下赋予普通用户sudo权限呢?此处将讲解一下方法. 在login我们的系统后,如果 ...

  3. Laravel大型项目系列教程(二)之用户管理

    Laravel大型项目系列教程(二) 一.前言 本节教程将大概实现用户的注册.修改个人信息.管理用户功能. 二.Let's go 1.创建用户注册视图 $ php artisan generate:v ...

  4. ASP.NET MVC+EF框架+EasyUI实现权限管理系列(17)-注册用户功能的细节处理(各种验证)

    原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(17)-注册用户功能的细节处理(各种验证) ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇)   (1):框 ...

  5. ASP.NET MVC+EF框架+EasyUI实现权限管理系列(12)-实现用户异步登录和T4模板

    原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(12)-实现用户异步登录和T4模板 ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇)   (1):框架搭建  ...

  6. Linux的VMWare中Centos7用户和用户管理三个系统文件(/etc/passwd-shadow-group解读)和批量创建用户user及用户工作环境path

    Linux 用户和用户组管理 用户工作环境PATH Linux系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统. 用 ...

  7. 【tornado】系列项目(一)之基于领域驱动模型架构设计的京东用户管理后台

    本博文将一步步揭秘京东等大型网站的领域驱动模型,致力于让读者完全掌握这种网络架构中的“高富帅”. 一.预备知识: 1.接口: python中并没有类似java等其它语言中的接口类型,但是python中 ...

  8. Linux系列教程(七)——Linux帮助和用户管理命令

    上篇博客我们介绍了Linux文件搜索命令,其中find是用的最多的也是功能最强大的文件或目录搜索命令,和另一个搜索命令locate的区别是,find命令是全盘搜索,刚创建的文件也能搜索的到,而loca ...

  9. Linux系列教程(十五)——Linux用户和用户组管理之用户管理命令

    上篇博客我们介绍了用户管理的相关配置文件,包括用户信息文件/etc/passwd,用户密码文件/etc/shadow:然后介绍了用户组信息文件/etc/group,用户组密码文件/etc/gshado ...

随机推荐

  1. window本地运行mapreduce程序

    mapreduce的运行方式一般有两种,一是从本地导出一个jar包,在传到虚拟机上运行,这样调试起来非常的不方便,如果出现错误就需要重新导出jar包. 第二种方式是在本地直接运行,但是在运行前需要进行 ...

  2. POJ 1169

    #include<iostream> #include<algorithm> #include<vector> #include<set> #defin ...

  3. 1301班 github安装及账户注册

    1.下载github 下载地址: http://git-scm.com/download/ 2.账号注册 进入:mukever.online 在右下角的“New user? Create an acc ...

  4. Flume搭建及学习(基础篇)

    转载请注明原文出处:http://www.cnblogs.com/lighten/p/6830439.html 1.简介 该文主要是翻译官方的相关文档,源地址点击这里.介绍一下Flume的一些基本知识 ...

  5. linux 可执行文件与写操作的同步问题

    当一个可执行文件已经为write而open时,此时的可执行文件是不允许被执行的.反过来,一个文件正在执行时,它也是不允许同时被write模式而open的.这个约束很好理解,因为文件执行和文件被写应该需 ...

  6. as和is,但is也有as所没有的功能[C#] --转载 甘木

    在C#中,我们可以使用is as操作符来判断某数据类型和其它指定类型的关系 1. 用is运算符验证基础类型 C#允许在继承链中向下转型,所以如果DerivedClass派生自BaseClass,那么D ...

  7. centos7的防火墙配置

    centos7 不在使用iptables作为防火墙, 而是使用firewalld规则, 好吃是支持动态更新, 不需要重启服务, 第二个就是加入了zone概念. 所以和centos6在防火墙配置上有很大 ...

  8. Druid连接池(四)

    十七.Druid加密 运维和DBA都不希望把密码明文直接写在配置文件中,Druid提供了数据库密码加密的功能. ConfigFilter的作用包括: 从配置文件中读取配置 从远程http文件中读取配置 ...

  9. haproxy 学习记录

    1.简易安装 make TARGET=linux26 prefix=/usr/local/haproxy install 启动haproxy在sbin目录,其余的在doc目录 2. 配置 hdr_be ...

  10. nodejs zip压缩版安装与配置

    Node.js 1.下载 下载地址:https://nodejs.org/zh-cn/download/ 选择相应的版本下载 2.解压缩 将文件解压到要安装的位置,并新建两个目录 node-globa ...