赞
踩
目录
3.2PAM(Pluggable Authentication Modules)可插拔式认证模块
[root@xlj1 ~]# chattr +i /etc/passwd /etc/shadow 锁定文件并查看状态
[root@xlj1 ~]# lsattr /etc/passwd /etc/shadow
----i-------- /etc/passwd
----i-------- /etc/shadow
适用于新用户
[root@localhost ~]# vi /etc/profile 进入配置文件修改限制命令条数。适合新用户
export HISTSIZE=200 修改限制命令为200条,系统默认是1000条profile
[root@localhost ~]# source /etc/profile 刷新配置文件,使文件立即生效
适用于当前用户
[root@localhost ~]# export HISTSIZE=200
[root@localhost ~]# source /etc/profile
[root@localhost ~]# source /etc/profile 刷新配置文件,使文件立即生效
强制在下次登录时更改密码
[root@xlj1 ~]# chage -d 0 zhangsan
[root@xlj1~]# vi /etc/profile
HISTSIZE=200
登录时自动清空历史命令(永久)
[root@xlj1 ~]# echo"" > ~/.bash_history
登录时自动清空历史命令(临时)
[root@xlj1 ~]#vim ~/.bash_logout
history -c
clear
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。