Hide SSH Terminal Script From User
Hello,
I am running the following script in /etc/bashrc to automatically record all terminal sessions to file on my server. (I regularly use contractors to install new scripts on my server, and have run into problems in the past where they have also installed disruptive scripts that redirect users, or other malicious scripts. I am hoping that by recording their activities, I can detect any malicious activities before they cause any harm).
test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -f $HOME/$(date +"d-b-%y_%H-%M-%S")_shell.log)
When a user first logs in to my Linux server by ssh, they see the following:
Script started, file is /root/11-Oct-15_18-38-22_shell.log
My question is, is there any way to run this script without the user being notified that the script has been started?
Or perhaps another script that achieves the same without notifying the user?
Thanks for the help.
Last edited by dewpoint; 10-11-2015 at 08:19 PM.
|