CentOS7系列--1.3CentOS7用户管理

CentOS7用户管理

1. 添加用户

[[email protected] ~]# useradd jack

[[email protected] ~]# 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.

[[email protected] ~]# exit

2. 切换用户

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

login as: jack

[email protected]‘s password:

[[email protected] ~]$ su -

Password:

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

[[email protected] ~]#

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

[[email protected] ~]# usermod -G wheel jack

[[email protected] ~]# 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的邮件转到新创建的用户

[[email protected] ~]# 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

原文地址:https://www.cnblogs.com/gispathfinder/p/8833046.html

时间: 2024-08-02 18:43:35

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

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

对于linux用户来讲,普通用户的权限是有一定限制的,所以在有些操作的时候,是需要sudo权限的,那么如何在linux下赋予普通用户sudo权限呢?此处将讲解一下方法. 在login我们的系统后,如果是普通用户,我们可以使用su - root来切换到root用户下进行操作,在root用户下,命令行输入 visudo回车即可进入/etc/sudoers下,找到 ## Allow root to run any commands anywhere root    ALL=(ALL)       AL

oracle 11g系列 用户管理实验报告

Oracle 数据库用户管理 在数据库中各种对象被以用户(方案)的方式组织管理 在创建对象和访问对象前,首先创建对象的拥有者---用户 用户有相关的属性,有些必须明确设置,有些可以用默认值 下面是用户的相关属性 --用户名 --口令 --默认表空间 --临时表空间 --账户状态 --空间配额 --概要文件 其中用户名和口令是必须要设置的 数据库当中的对象是一schema的方式组织管理的 数据库当中存在哪些类型的对象 对象是放在user下,通常称之为用户下的对象,又称作schema. 模式对象指的

SSH系列:(9)用户管理-JSP页面

1.listUI.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags"%> <html> <head>     <title>用户管理</title>     <%@include f

oracle系列(二)oracle体系结构和用户管理

博主QQ:819594300 博客地址:http://zpf666.blog.51cto.com/ 有什么疑问的朋友可以联系博主,博主会帮你们解答,谢谢支持! 在使用oracle之前,我们一定要对oracle的体系结构有深入的理解,与之前我们学习过的sqlserver体系结构是不一样的,所以对于我们来说是一个全新的内容. 一.oralce体系结构 1.概述 Oracle的体系结构是数据库的组成,工作过程,以及数据库中数据的组织与管理机制,要了解oracle数据库的体系结构,就必须要理解oracl

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

上篇博客我们介绍了用户管理的相关配置文件,包括用户信息文件/etc/passwd,用户密码文件/etc/shadow:然后介绍了用户组信息文件/etc/group,用户组密码文件/etc/gshadow.用户的家目录,以及用户的模板目录,那么我们如何创建用户呢?这篇博客我们将学习用户管理的相关命令. 1.添加用户命令:useradd ①.命令名称:useradd ②.英文原意: ③.命令所在路径:/usr/sbin/useradd ④.执行权限:root ⑤.功能描述:添加新用户 ⑥.语法: u

linux命令学习系列-用户管理2

先复习一下上节内容: 1.       用户和用户组的基本介绍,UID,GID,用户类型(普通用户,系统用户,根用户) 2.       用户和组常用命令id,groups,who命令,加用户名参数和不加用户名参数的区别 3.       用户添加命令useradd,执行命令后系统进行了哪些操作,如何通过参数自定义添加用户信息 4.       同时还给大家留了一个小作业,不知道大家完成了没有呢,作业的命令是 useradd –u 503 –g users –d /home/users user

centos7下mysql 用户管理和权限设置

1.进入mysql命令行,输入root及密码[[email protected] ~]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 19Server version: 5.7.22 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle an

cobbler部署centos6与centos7系列

cobbler部署centos6与centos7系列 转载自:http://www.jianshu.com/p/a4bed77bf40d 版权声明:完全抄自 http://www.jianshu.com/p/a4bed77bf40d 自动化工具分为三大类 预备类(Os Provisioning) PXE cobbler 配置管理类(Os config & Devops ) cfengine chef puppet saltstack func fabric ansible 监控类(Mointor

用户管理,目录权限,定时任务及软件包管理工具

linux用户管理 linux有几种用户身份,好比qq群 1.QQ群主,想干嘛就干嘛,想踢人就踢人------等于linux的root用户,权利最大 2.QQ群管理员,群主给与他的比较大的权限--------等于linux命令加上sudo,默认以root去执行命令 3.渣渣用户,QQ群里的小白,权利特别低--------等于linux的普通用户,用于保证服务器安全,防止删除等危险操作 UID,GID UID 用户的id号,root是0,普通用户从1000开始 GID,是用户组的ID号 linux