mail attachment not sending from servers using mail command
As part of SSH monitoring in our servers, I have created a bash script and put it in my /etc/profile.d/ directory. So I can see that this script executed with every SSH login and I am able to get the detail of the user, who is logged in and from which IP etc using it.
Actually I am getting this mail with content as a message body. I wanted to get this as a text file attached
I am writing these details in /tmp/ssh_monitoring.txt using this script
I used the following mail command to achieve it but I am not success
" | mail -s "`whoami` has just logged on `uname -a | awk '{ name = $2 } END { print name }'`" "${EMAIL_RECEPIENTS}" -a /tmp/ssh_monitoring.txt
It will be good to get the support of this issues
Roni
|