history

Linux操作系统加固

匿名 (未验证) 提交于 2019-12-02 21:59:42
1 . 账号和口令 1.1 禁用或删除无用账号 减少系统无用账号,降低安全风险。 操作步骤 使用命令 userdel <用户名> 删除不必要的账号。 使用命令 passwd -l <用户名> 锁定不必要的账号。 使用命令 passwd -u <用户名> 解锁必要的账号。 1.2 检查特殊账号 检查是否存在空口令和root权限的账号。 操作步骤 查看空口令和root权限账号,确认是否存在异常账号: 使用命令 awk -F: ‘($2=="")‘ /etc/shadow 查看空口令账号。 使用命令 awk -F: ‘($3==0)‘ /etc/passwd 查看UID为零的账号。 加固空口令账号: 使用命令 passwd <用户名> 为空口令账号设定密码。 确认UID为零的账号只有root账号。 1.3 添加口令策略 加强口令的复杂度等,降低被猜解的可能性。 操作步骤 使用命令 vi /etc/login.defs 修改配置文件。 PASS_MAX_DAYS 90 #新建用户的密码最长使用天数 PASS_MIN_DAYS 0 #新建用户的密码最短使用天数 PASS_WARN_AGE 7 #新建用户的密码到期提前提醒天数 使用chage命令修改用户设置。 例如, chage -m 0 -M 30 -E 2000-01-01 -W 7 <用户名> 表示将此用户的密码最长使用天数设为30

linux下root文件夹被删除

匿名 (未验证) 提交于 2019-12-02 21:59:42
脑抽把 /root/ 文件删除了. 之后每敲命令,都会提示: -bash: history: /root/.bash_history: cannot create: No such file or directory 从网上了解到: .mkdir /root cp -a /etc/skel/.[!.]* /root 主要是把 /etc/skel/里面的文件拷贝回去就行了。 转自https://blog.csdn.net/minicto/article/details/53693765 文章来源: linux下root文件夹被删除

【Linux】history命令显示时间记录

匿名 (未验证) 提交于 2019-12-02 21:56:30
inux和unix上都提供了history命令,可以查询以前执行的命令历史记录 但是,这个记录并不包含时间项目 因此只能看到命令,但是不知道什么时间执行的 以下便是history记录时间的方法: 第一步:查看系统是否支持 注:本方法只对bash-3.0以上版本有效 执行rpm -q bash即可显示bash的版本 [root@localhost ~]# rpm -q bash bash-4.2.46-20.el7_2.x86_64 可见我系统中的bash版本没有问题 第二步:以root用户编辑/etc/bashrc文件,加入如下内容 HISTFILESIZE=2000 HISTSIZE=2000 HISTTIMEFORMAT="%Y%m%d-%H%M%S: " 或者 HISTTIMEFORMAT="%Y%m%d %T " vim /etc/bashrc HISTFILESIZE=5000 HISTSIZE=5000 HISTTIMEFORMAT="%Y%m%d-%H%M%S: " 执行生效 命令: export HISTTIMEFORMAT [root@localhost ~]# export HISTTIMEFORMAT 注:以上方法,也可以使用以下一条语句执行: echo "HISTFILESIZE=5000" >> /etc/bashrc && echo "HISTSIZE

linux指令:软连接与历史命令

匿名 (未验证) 提交于 2019-12-02 21:56:30
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ifubing/article/details/90745985 ln -s 软连接 格式: history 历史 格式: history 显示所有的历史指令 history 10 显示最近的十个指令 例: 执行编号为178的历史记录 先history 再!178 文章来源: https://blog.csdn.net/ifubing/article/details/90745985

Linux history命令

匿名 (未验证) 提交于 2019-12-02 21:56:30
Linux history命令 Outline: 查看― history 查看显示时间戳― export HISTTIMEFORMAT=’%F %T ’ 清除历史-- history -c 查看后5 条-- history 5   history命令主要用于显示历史命令, 重新执行历史命令。   Linux系统当你在shell(控制台)中输入并执行命令时,shell会自动把你的命令记录到历史列表中,一般保存在用户目录下的.bash_history文件中,每个用户文件下都有一个历史命令的保存文件,相互之间不会冲突。默认保存1000条,你也可以更改这个值,/etc/profile中进行修改,找到HISTSIZE=1000,把这里的1000改成你想要的值。   -c :将目前的shell中的所有 history 内容全部消除   -a :将目前新增的history 指令新增入 histfiles 中,若没有加 histfiles,则预设写入 ~/.bash_history   -r :将 histfiles 的内容读到目前这个 shell 的 history 记忆中   -w :将目前的 history 记忆内容写入 histfile      1.用vi编辑器打开/etc/profile   3.source /etc/profile   4.执行history    使用

react-router简明学习

匿名 (未验证) 提交于 2019-12-02 21:53:52
前面的话   路由用来分发请求。后端是提供服务的,所以它的路由是在找controller,前端是显示页面的,所以它的路由是在找component。本文将详细介绍react-router-dom的内容 Router   Router是路由器组件的低阶接口,通常会使用如下某个高阶router来替代它 <BrowserRouter> <HashRouter> <MemoryRouter> <NativeRouter> <StaticRouter> 【BrowserRouter】   最常用的是BrowserRouter import { BrowserRouter } from 'react-router-dom' <BrowserRouter basename={optionalString} forceRefresh={optionalBool} getUserConfirmation={optionalFunc} keyLength={optionalNumber} > <App/> </BrowserRouter>   1、basename: 当前位置的基准 URL。如果页面部署在服务器的二级(子)目录,需要将 basename 设置到此子目录。 正确的 URL 格式是前面有一个前导斜杠,但不能有尾部斜杠 <BrowserRouter basename="/calendar"/>

Is there a way to switch Bash or zsh from Emacs mode to vi mode with a keystroke?

帅比萌擦擦* 提交于 2019-12-02 21:07:58
I'd like to be able to switch temporarily from emacs mode to vi mode, since vi mode is sometimes better, but I'm usually half-way through typing something before I realize I want to use vi mode. I don't want to switch permanently to vi mode, because I normally prefer emacs mode on the command line, mostly because it's what I'm used to, and over the years many of the keystrokes have become second nature. (As an editor I generally use emacs in viper mode, so that I can use both vi and emacs keystrokes, since I found myself accidentally using them in vi all the time, and screwing things up, and