An electrical socket includes a magnet connected to a shield. The shield blocks access to receptacles of the socket when the magnet is at a rest position but moves away and allows access to the receptacles when the magnet is moved away from its rest position. The magnet is attached to a spring so that the spring pulls the magnet toward the rest position. A plug includes a plug magnet to attract the socket's magnet. When the plug is brought close to the socket, the socket magnet is pulled away from the rest position, moving the shield away and allowing the plug to be inserted.