Prev | Current Page 53 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


IP-Based Access Control
An additional level of protection can be added, this time verifying the Internet
Protocol (IP) address of the machine from which the request to use phpMyAdmin
is received.
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'> [from]
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
Chapter 2
[ 39 ]
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.


Pages:
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65