安全矩阵

 找回密码
 立即注册
搜索
查看: 4833|回复: 0

网络安全攻防:Shell安全

[复制链接]

991

主题

1063

帖子

4315

积分

论坛元老

Rank: 8Rank: 8

积分
4315
发表于 2021-2-24 21:47:23 | 显示全部楼层 |阅读模式
原文链接:网络安全攻防:Shell安全


1. history 文件

通过~/.bash_history文件记录系统管理员的操作记录,定制.bash_history格式。

(1)以Root用户登录服务器,在/etc/profile.d/下新建一个文件history_command。

(2)编辑刚才创建的文件,写入内容。

export HISTFILE=$HOME/.bash_history
export HISTSIZE=1200
export HISTFILESIZE=1200
export HISTCONTROL=ignoredups
export HISTTIMEFORMAT=”`whoami` %F %T ”
shopt-s histappend
typeset-r HISTTIMEFORMAT

(3)使用source/etc/profile.c/history_command,使其生效。

2. 执行权限

以数据库为例,从安全角度考虑,需要进行如下更改。

# chown mysql:mysql/usr/bin/mysql*
# chmod 700/usr/bin/mysql*

mysql用户是DBA专用用户,其他用户将不能执行mysql等命令。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-9-20 23:31 , Processed in 0.019214 second(s), 18 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表