SSH from Windows without entering a password

I need to access “WD My cloud ex2 ultra” from windows to turn it off when I don’t need to have it turned on through a .bat file.
The ssh access is ok, but I don’t want the passwd to be visible and I prefer to create public and private keys using Putty.
Can someone help me set it up?

Hi @autofalcon,

Please refer below link to set SSH password :

Hope it helps!!

These bots aren’t helpful.
I don’t think you’ll be able to send commands using putty. You’ll probably have to use plink from the same developer.
Generate your keys of your root user using the command ssh-keygen and press enter in all prompts. You’ll need to point to the private key when connecting to the NAS.

Thanks everyone for your help. I have managed to create the keys (private and public) and access the WD with the Putty command to turn it off. I also manage to turn it on from a windows OS (wol), but when the WD starts it removes the ssh public key and I can no longer execute any putty commands. Does anyone know if it’s possible to run a script when starting the WD? I have tested the script, but I can’t configure it to run when WD boots. Thanks