We calculate the shear viscosity $eta = eta_{emu}+eta_{n}$ in a neutron star core composed of nucleons, electrons and muons ($eta_{emu}$ being the electron-muon viscosity, mediated by collisions of electrons and muons with charged particles, and $eta_{n}$ the neutron viscosity, mediated by neutron-neutron and neutron-proton collisions). Deriving $eta_{emu}$, we take into account the Landau damping in collisions of electrons and muons with charged particles via the exchange of transverse plasmons. It lowers $eta_{emu}$ and leads to the non-standard temperature behavior $eta_{emu}propto T^{-5/3}$. The viscosity $eta_{n}$ is calculated taking into account that in-medium effects modify nucleon effective masses in dense matter. Both viscosities, $eta_{emu}$ and $eta_{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 $eta$ for different equations of state in neutron star cores, and compare $eta$ with the bulk viscosity in the core and with the shear viscosity in the crust.