NOTIFY USER WHEN LOGIN SSH TO SERVER


NOTIFIKASI SSH KETIKA LOGIN KE SERVER

[root@InxDev01 ssh]# vim /etc/ssh/login-notify.sh
if [ “$PAM_TYPE” != “close_session” ]; then
host=”`hostname`”
subject=”SSH Login: $PAM_USER from $PAM_RHOST on $host”
logger $subject
fi
[root@InxDev01 ssh]# chmod +x  /etc/ssh/login-notify.sh
[root@InxDev01 ssh]# vim /etc/pam.d/sshd
Tambah baris
 
session optional pam_exec.so seteuid /etc/ssh/login-notify.sh
Jika sudah ok rubah menjadi
session required pam_exec.so seteuid /etc/ssh/login-notify.sh
CHANGE MODIFIED FILE
date -d “$(stat -c “%y” /etc/ssh/login-notify.sh)” “+%Y%m%d%H%M”
TANGGAL=`date -d “$(stat -c “%y” /etc/ssh/login-notify.sh)” “+%Y%m%d%H%M”`
touch -m -t ${TANGGAL} login-notify.sh
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: