Enabling SSH Access for Root Login in Raspberry Pi with Raspbian OS

Raspberry Pi is a very nice small  single board computer system, because it is low cost, compact, and low power. It is powerful enough to do many things, so we can use it for “all in one” servers, ranging from web, database, backup, ftp,  or even for ipcam recording. For all of those services, it is often needed to be accessible via remote SSH login.

To enable SSH login, run “sudo raspi-config” and go to [interfacing option] -> SSH . After enabling SSH the system may show a warning for changing default password. Change the password for pi by command “sudo passwd pi”, and the root by command “sudo passwd root”. Changing this default password after enabling the SSH access with the new one is very important because the raspberry pi is now can be accessed by anyone from anywhere (depending on the network accessibility).

To enable root login via SSH, edit the ssh_config in /etc/ssh/ssh_config by command “sudo nano /etc/ssh/ssh_config”, and change the value of “PermitRootLogin” to “yes”. Save the file  and then restart the ssh service by command “/etc/init.d/ssh restart”. Now the root account of the Raspberry Pi is ready to be accessed via remote SSH.