How to send email on user login in ubuntu
Step 4: Click App Passwords (Check 2 - step verification is ON).
Step 5: Select App as Mail and Device as other(type anything) and click GENERATE.
Step 7: Update the following command with your details(frommail, tomail, copied passcode).
echo ' ALERT - Root Shell Access on:' `date` `who` | s-nail -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from="frommail" -S smtp-auth-user=frommail -S smtp-auth-password=passcode -S ssl-verify=ignore -s "LOGIN ALERT" -v "tomail"
Step 8: Open .bashrc
nano .bashrc
Step 9: Paste the command in step 7 in last line of the file and save it. That's it!
Comments
Post a Comment