Skip to content

When logging into server by ssh then tweet notify. Tested on CentOS 7. sshでログインしたらTwitterにつぶやく。CentOS 7 で動作テスト済み。

License

Notifications You must be signed in to change notification settings

IchikawaYukko/sshLoginNotifytoTwitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Go Version

Install

  1. Clone this repository and build. Or download compiled release.
  2. Get Twitter App key and fill that into go/twitter-token.sh
  3. Put your own notify message into go/settings.json
  4. 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

*PHP version is NOT maintained anymore (tested under PHP 7.0 (rh-php70))

Install

  1. Clone this repository.
  2. Clone twitteroauth to sshLoginNotifytoTwitter.
  3. Get Twitter App key and fill that into php/settings.php
  4. Put your own notify message into php/settings.php
  5. Add below script to /etc/ssh/sshrc
source /opt/rh/rh-php70/enable
php /path/to/sshLoginNotify/twitterpost.php >> /path/to/sshLoginNotify/tweet.log
  1. 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

About

When logging into server by ssh then tweet notify. Tested on CentOS 7. sshでログインしたらTwitterにつぶやく。CentOS 7 で動作テスト済み。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published