Chapter 26. Banning Users

The LiveJournalsysban” mechanism provides the means for generic bans on site functionality given a block type and value. The type is what is being checked (IP address, e-mail address, etc.), and the value is the value which causes the block to activate (, for example).

The $LJHOME/bin/ tool lets you create and modify bans, and list existing ones.

There are two statushistory types tied to the sysban tool:

Logs the creation of new bans
Logs the modification of bans

The data each type logs varies depending on the type of ban and the information available when it was triggered. If a userid is available, it will be logged and the notes column will contain a short description of what caused the trigger along with a number of variables that may be useful in investigation of the situation.

Below are the current ban types. More can be added as necessary.



Blocked from site if IP address matches.


Blocked if e-mail matches. Return a fake “503 Service Unavailable” message to a user who tries to create a new account with the given e-mail address.


Blocked if value of unique cookie (from /admin/userlog.bml) matches.


Blocked if value (username) matches.

Ban management tool usage: [ --list {(1) args} | add {(2) args} | modify {(3) args} ]

(1) --banid=id | --what=bantype | --status=value | --bandate=datetime | --banuntil=datetime | --value=value | --note=string

(2) { --what=bantype | --value=value } | --status=value | --bandate=datetime | { --banuntil=datetime | --banlength=duration } | --note=string

(3) --banid=id | --status=value | --bandate=datetime | { --banuntil=datetime | --banlength=duration } | --value=value | --note=string

Datetime format is “YYYY-MM-DD HH:MM:SS”.
The note string can be changed to be blank.
Status can be “active” or “expired”.
Duration format is “N[dhms]” e.g. “5d” or “3h”.

Example 26.1. Using --list --what=ip --value= --add --what=email --banuntil='2007-12-12 00:05:00' --note='test' --add --what=uniq --value=jd57kdnes6jd6jdr --banlength=3d --note='3 day ban'