Skip to content

cbftp/sitewho-plus2

 
 

Repository files navigation

sitewho+2

/saīthuːplʌstu/

Why +2? Because this modfied version of pzs-ng's sitewho adds 2 things:

  • User ident@host and IP address
  • GeoIP2 County Code

Looking for unmodified sitewho instead? Get that here: sitewho (pzs-ng.eu)

Requirements

Make sure you have libmaxminddb installed or you will get errors about missing header and "record_info_for_database failed".

Debian: apt install libmaxminddb-dev geoipupdate

RedHat: yum install libmaxminddb-devel geoipupdate geoipupdate-cron

Or download from:

Installation

Now run make: make && make install

"make install" will not copy/create any sitewho files to your glftpd dir, so you can keep it seperate from the normal version. Just run sitewho+2 from current dir.

geoipupdate downloads and updates the required /var/lib/GeoIP/GeoLite2-Country.mmdb file. It needs /etc/GeoIP.conf which should have been created by "make install". If not, try: make geoipconf.

If geoipupdate runs OK you can add a weekly cron to keep mmdb updated:

ln -s which geoipupdate /etc/cron.weekly/geoipupdate

On RedHat installing geoipupdate-cron takes care of this

Usage

Only raw mode is changed, not normal output and the other modes. The new IP and CC fields should show up at the end of each line:

./sitewho --raw

"USER" " " "user1" "group" "ID" "1" "tag" "00:13:37" "" "0.0%" "/site" "1000" "ident@example.com" "93.184.216.34" "US"
"USER" " " "user2" "group" "ID" "2" "tag" "07:33:10" "" "0.0%" "/site" "1001" "ident@example.cz" "93.185.104.64" "CZ"

About

sitewho mod that adds user IP and GeoIP2 Country Code

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 87.8%
  • Makefile 12.2%