The router is Buffalo WZR-HP-G300NH2, flashed with DD-WRT v24-sp2 build 21676.
The SSH server settings is under Tab Services, Services.
The section is called Secure Shell
Select Enable for SSHd, keep the others as is. Then click Save and Apply Settings.
After that, you can use Putty to ssh to router. Let us have a look at my router.
The login user name is root, not the one for web ui.
Password is the one to sign in web ui.