#!/bin/bash
#给历史命令添加操作时间和操作用户
if ! grep HISTTIMEFORMAT /etc/bashrc &>/dev/null
then
echo '添加加操作时间和操作用户...'
echo 'export HISTTIMEFORMAT="%F %T `whoami` "' >>/etc/bashrc
else
echo 'HIST格式已修改'
fi
# SSH超时时间
if ! grep "TMOUT=600" /etc/profile &>/dev/null; then
echo "export TMOUT=600" >> /etc/profile
else
echo "TMOUTSSH超时时间 has been added,exit 1"
fi
标签:echo,etc,TMOUT,时间,ssh,操作,超时 From: https://www.cnblogs.com/cherishthepresent/p/17203453.html