_ _ _ ____ _ _
/ \ _ __ ___ | |_| |__ ___ _ __ | _ \ _ __ ___ (_) __| |
/ _ \ | '_ \ / _ \| __| '_ \ / _ \ '__| | | | | '__/ _ \| |/ _\` |
/ ___ \| | | | (_) | |_| | | | __/ | | |_| | | | (_) | | (_| |
/_/ \_\_| |_|\___/ \__|_| |_|\___|_| |____/|_| \___/|_|\__,_|
bbs
XQTRs lair...
Home //
Blog //
NULL emag. //
Files //
Docs //
Tutors //
GitHub repo
some bbs software like mystic bbs, has a feature to blacklist ips
that are making too many connections in a short time period to your
bbs. this prevents attacks, so its useful. the bad thing with this,
is that some times, we as users/sysops do many connection attempts
and finally, our ip gets into that file... resulting to not be able
to connect, even at our bbs sometimes.
also, many sysops don't know about this or they don't know how to
clear it or they just forget to clear it, from time to time. this way
you loose visitors, who for some weird reason, they got "banned" and
not they can't even connect to your bbs.
a solution to this problem is obviously, to clear the file. but
because we have so many things to do... we will do it automatically,
using cron or other event manager. the solution is apply able to any
bbs software, you just have to figure out, which file you have to
delete etc. for example we will make a simple script to clear a
mystic bbs blacklist.txt file. the script is simple as deleting the
file and also creating it with the 'touch' command... this is very
important! let's see the commands first:
rm /blacklist.txt
touch /blacklist.txt
for a pi installed mystic bbs... you should have something like this:
rm /home/pi/mystic/data/blacklist.txt
touch /home/pi/mystic/data/blacklist.txt
simple! make the script executable and add it as a cron job like.
initiate cron editor with: crontab -e
MAKE SURE YOU ARE NOT ROOT! make this as a simple/normal user!
in the editor that will open add this line in the bottom of the file:
00 */2 * * *
example:
00 */2 * * * /home/pi/mystic/clearbllst.sh
save and exit the editor... the new cron job will be installed. the
cron command/job we applied, will delete the blacklist.txt file every
two hours at exactly 00/zero minutes. this means that someone that
makes too many logins and got banned... he will have to wait for
about two hours to be able to login again. you can change this to
whatever you want. for example to erase the file every 12 hours you
will enter the command like this:
00 */12 * * * /home/pi/mystic/clearbllst.sh
it is very important to re-create the file! if you just delete it,
mystic server (mis) will create it, but with root access only! so
next time you will go to edit it, you have to be a root user! this is
not a good way to do it and the file originally belongs to a normal
user. so we execute our cronjob as a normal user and recreate the
file, to avoid the creation of the blacklist file with root access.
if you liked this tutor press the like button below and subscribe to
our ascii-feed... :p
[ like ] [ subscribe ] [ back ]