欢迎来到IDC91站长网!
解决服务器各种技术问题,加微信uecomzsr

Linux

当前位置: IDC91 > 服务器教程 > Linux

CentOS 7安装完成后初始化的方法

时间:2022-05-27 00:17:43|栏目:Linux|点击:

1、添加用户

新增名为"wang"的用户

[root@vdevops ~]# useradd wang #添加账户
[root@vdevops ~]# passwd wang #设置密码
Changing password for user wang.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@vdevops ~]# exit #退出
以用户"wang"为例,设置其为唯一拥有管理员权限的账户
[root@vdevops ~]# usermod -G wheel wang
[root@vdevops ~]# vim /etc/pam.d/su
[html] view plain copy print?
#%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 
设置root账户的邮件转发
# Person who should get root's mail
# 最后一行,取消注释,改变用户名称
root: wang

上一篇:ubuntu 安装openssh服务器的教程详解

栏    目:Linux

下一篇:linux系统SSL证书部署https单/多站点

本文标题:CentOS 7安装完成后初始化的方法

本文地址:https://www.idc91.com/fuwuqizl/2696.html

广告投放 | 联系我们 | 免责申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

Copyright © 2023 IDC91.COM 版权所有晋ICP备17006296号