Electrostatic interaction between two ion-penetrable spheres near a horizontal plate or in a slit pore is investigated theoretically. The orientation of the line connecting the two particle centers can be arbitrary relative to the plate(s). The electrosta