Sometimes it’s useful to have incredibly insecure SSH on a machine, such that it allows logging in as root without a password. It’s pretty self explanatory that you shouldn’t enable this on a box connected to an unsecured network, but just to be clear;
Now that we’ve got that out of the way, let’s get onto configuring this thing!
It’s pretty straightforward to get this set up;
Remove
root’s password.passwd -d rootEnable both
rootlogin and logging in without a password.Edit
/etc/ssh/sshd_configand change these options;PermitRootLogin yes PermitEmptyPasswords yesThe special sauce: Mark
sshas a “secure TTY”.Edit
/etc/securettyand addsshto the end;sshThis step is the not-so-obvious one, and the reason I wrote this post in the first place!
You’re done! You can now SSH into your box as
rootwithout a password;$ ssh root@example.com $ id uid=0(root) gid=0(root) groups=0(root)
Source: Super User