博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SSH Session Recorder
阅读量:4685 次
发布时间:2019-06-09

本文共 687 字,大约阅读时间需要 2 分钟。

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/

转载于:https://www.cnblogs.com/diyunpeng/p/3546585.html

你可能感兴趣的文章
密码锁
查看>>
Android创建与读取Excel
查看>>
AVL树-查找-插入
查看>>
Codeforces 600E Lomsat gelral(dsu on tree)
查看>>
生成验证码语法(旧版)
查看>>
优化以及bug
查看>>
Factorial Trailing Zeroes
查看>>
daomain
查看>>
C pointers和Java references 的区别
查看>>
理解MapReduce
查看>>
[Golang] GoConvey测试框架使用指南
查看>>
值类型和引用类型区别,一看就懂
查看>>
UVa 11375 Matches
查看>>
JdbcTemplate
查看>>
leetcode 2. 两数相加(Add Two Numbers)
查看>>
Crimm Imageshop 2.0 发布。
查看>>
分页存储过程
查看>>
不可忽略的知识点
查看>>
plist文件的归档,解档
查看>>
Xcode中修改默认文件头部注释
查看>>