Overview 日本語
This command login-tweet
will tweet notify message when user logged into server through SSH.
Tested under CentOS 7 and go1.14.2 linux/amd64
This command is depends on geoiplookup
command. So you need install it first.
Package GeoIP
is required for CentOS/RHEL. Package geoip-bin
is required for Debian/Ubuntu.
- Clone this repository and build. Or download compiled release.
- Get Twitter App key and fill that into go/twitter-token.sh
- Put your own notify message into go/settings.json
- Add below script to your .bash_profile (not .bashrc)
source ~/path/to/go/twitter-token.sh
~/path/to/go/login-tweet
or (with logging)
source ~/path/to/go/twitter-token.sh
~/path/to/go/login-tweet -v >> ~/tweet.log
or on root's .bash_profile
source ~/path/to/go/twitter-token.sh
~/path/to/go/login-tweet -r
*PHP version is NOT maintained anymore (tested under PHP 7.0 (rh-php70))
- Clone this repository.
- Clone twitteroauth to sshLoginNotifytoTwitter.
- Get Twitter App key and fill that into php/settings.php
- Put your own notify message into php/settings.php
- Add below script to /etc/ssh/sshrc
source /opt/rh/rh-php70/enable
php /path/to/sshLoginNotify/twitterpost.php >> /path/to/sshLoginNotify/tweet.log
- If you want notify when some one get root privlege add below to /root/.bashrc
source /opt/rh/rh-php70/enable
php /path/to/sshLoginNotify/twitterpost.php -r >> /path/to/sshLoginNotify/tweet.log