Databases Reference
In-Depth Information
To achieve this level of protection, we construct rules allowing or denying access,
and specify the order in which these rules will be applied.
Rules
The format of a rule is:
<'allow' | 'deny'> <username> [from] <source>
from
being optional. Here are some examples:
allow Bob from 1.2.3.4
User
Bob
is allowed access from IP address
1.2.3.4
.
allow Bob from 1.2.3/24
User
Bob
is allowed from any address matching the network
1.2.3
(this is CIDR IP matching).
deny Alice from 4.5/16
User
Alice
cannot access when located on network
4.5
.
allow Melanie from all
User
Melanie
can login from anywhere.
allow Julie from localhost
Equivalent to 127.0.0.1
deny % from all
all
can be used as an equivalent to 0.0.0.0/0, meaning any host. Here, the
%
sign
means any user.
The source part can also be formed with the special names
localnetA
,
localnetB
, or
localnetC
. These represent the complete class A, B, or C network in which the web
server is located. Note that phpMyAdmin relies on the
$_SERVER["SERVER_ADDR"]
PHP parameter for this feature. Usually we will have several rules. Let's say we wish
to have the two rules that follow:
allow Marc from 45.34.23.12
allow Melanie from all
We have to put them in
config.inc.php
(in the related server-specific section)
as follows:
$cfg['Servers'][$i]['AllowDeny']['rules'] =
array('allow Marc from 45.34.23.12',
'allow Melanie from all');
Search WWH ::
Custom Search