리눅스 원격 SSH접속시 텔레그램(telegram) 알람
# Operation System/Linux2019. 12. 18. 10:42리눅스 원격 SSH접속시 텔레그램(telegram) 알람

ssh설정폴더에 /etc/ssh/sshrc 파일생성 후 아래와 같이 작성 (실행권한 주세요~ chmod +x sshrc) #!/bin/bash DESTINATION="텔래그램 채널(대화방) ID" BOTID="텔레그램 봇 ID 입력" remoteip=`w | grep $USER | awk '{print $3}'` HOSTNAME_S=`hostname -s` conntime=$(date +"%Y-%m-%d %H:%M:%S") msg=`echo -e "접속서버 : " $HOSTNAME_S " \n접속IP : " $remoteip "\n접속시간 : "$conntime "\n"$USER"계정이 접속되었습니다!!"` curl -s \ --request POST https://api.telegram.org/bot{..

image