We calculate the shear viscosity \eta \approx \eta _ { \mathrm { e \mu } } + \eta _ { \mathrm { n } } in a neutron star core composed of nucleons , electrons and muons ( \eta _ { \mathrm { e \mu } } being the electron-muon viscosity , mediated by collisions of electrons and muons with charged particles , and \eta _ { \mathrm { n } } the neutron viscosity , mediated by neutron-neutron and neutron-proton collisions ) . Deriving \eta _ { \mathrm { e \mu } } , 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 _ { \mathrm { e \mu } } and leads to the non-standard temperature behavior \eta _ { \mathrm { e \mu } } \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 _ { \mathrm { e \mu } } and \eta _ { \mathrm { 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 .