Raspbian

Enable SSH (see here):

sudo raspi-config

Then:

    1. Enter sudo raspi-config in a terminal window

    2. Select Interfacing Options

    3. Navigate to and select SSH

    4. Choose Yes

    5. Select Ok

    6. Choose Finish

Then:

https://ekuric.wordpress.com/2013/01/20/raspbian-wheezy-root-password/

Then:

https://raspberrypi.stackexchange.com/questions/48056/login-as-root-not-possible

[Edit]