We calculate the shear viscosity η ≈ ηeµ +ηn in a neutron star core composed of nucleons, electrons and muons (ηeµ being the electron-muon viscosity, mediated by collisions of electrons and muons with charged particles, and ηn the neutron viscosity, mediated by neutron-neutron and neutronproton collisions). Deriving ηeµ, we take into account the Landau damping in collisions of electrons and muons with charged particles via the exchange of transverse plasmons. It lowers ηeµ and leads to the non-standard temperature behavior ηeµ ∝ T −5/3 . The viscosity ηn is calculated taking into account that in-medium effects modify nucleon effective masses in dense matter. Both viscosities, ηeµ and ηn, can be important, and both are calculated including the effects of proton superfluidity. They are presented in the form valid for any equation of state of nucleon dense matter. We analyze the density and temperature dependence of η for different equations of state in neutron star cores, and compare η with the bulk viscosity in the core and with the shear viscosity in the crust.