首页 > 其他 > 详细

SSH Session Recorder

时间:2014-02-13 04:51:00      阅读:377      评论:0      收藏:0      [点我收藏+]

If you want to record your root ssh session  create a file .bash_profile  . and copy below line by line change the email address where you want to recive the SSH log mail.

nano /root/.bash_profile

CURDATE=$(date +%F-%T)

RAND=$RANDOM

EMAILS=”user@example.com otherrecipient@example.com”

script -f -q /tmp/session-$USER-$CURDATE-$RAND.log

for EMAIL in $EMAILS; do

cat “/tmp/session-$USER-$CURDATE-$RAND.log” | mail -s “SSH session transcript for $USER at $CURDATE” $EMAIL

 

done

rm -f /tmp/session-$USER-$CURDATE-$RAND.log

exit

 

http://linux-tips.org/article/13/how-to-record-a-linux-session

http://www.gkhan.in/ssh-session-recording-script/

SSH Session Recorder

原文:http://www.cnblogs.com/diyunpeng/p/3546585.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!