The magnetosphere shields the surface of the Earth from the charged particles of the solar wind and is generated by electric currents located in many different parts of the Earth. It is compressed on the day (Sun) side due to the force of the arriving particles, and extended on the night side.
Earth's magnetic field (and the surface magnetic field) is approximately a magnetic dipole, with the magnetic field S pole near the Earth's geographic north pole and the other magnetic field N pole near the Earth's geographic south pole.