Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/feed-rss2.php on line 8
Enable SSH Login Notification on Linux – AKLWEB HOST LLC Support Center https://support.aklwebhost.com Fri, 06 Dec 2019 23:43:16 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 Enable SSH Login Notification on Linux https://support.aklwebhost.com/knowledgebase/enable-ssh-login-notification-on-linux/ https://support.aklwebhost.com/knowledgebase/enable-ssh-login-notification-on-linux/#respond Fri, 06 Dec 2019 13:52:25 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=2514 Is your Linux server accessed by multiple users? If so, consider adding an SSH login notification whenever someone logs in.

The examples below send an email when someone logs into your server. For this to work, your server must be able to send mail using the mail command. You may follow this tutorial to setup Exim with Gmail if your AKLWEB Host account is not verified to send mail.

Replace YOUR_EMAIL_ADDRESS with the email address that you want to receive login notifications.

CentOS

Open the file ~/.bash_profile in a text editor.

Append the following lines:

IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")

echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' YOUR_EMAIL_ADDRESS

Ubuntu/Debian

Open the file ~/.bashrc in a text editor.

Append the following lines:

IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")

echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' YOUR_EMAIL_ADDRESS
]]>
https://support.aklwebhost.com/knowledgebase/enable-ssh-login-notification-on-linux/feed/ 0