How to set up passwordless login for SSH with different usernames?

It's possible. Perhaps an issue of case sensitivity? You mention "DiskMaster" and "diskmaster". If the Synology is any kind of *nix then usernames will definitely be case sensitive.

Check the authorized_keys file if you used cut and paste, like I did recently, to ensure there aren't any unwanted line breaks in the newly added key listing.

You can check logs on the Synology to gain more insight into the source of the login prompt. You may need to enable logging in sshd_config usually located in /etc or /etc/ssh.

Also consider file permissions on the remote authorized keys. Have you added the remote to the list of known hosts? (You would be rompted prior to login to do this).

Finally, make sure the remote resolves the hostname of the source address such that it matches the hostne in the authorized_keys file.


Having different usernames should not matter if you are already specifying the remote username on the SSH command. The default would have been your local username.

However you need to generate a key pair for your local user and copy over the public key to the the appropriate .ssh/authorized_keys file in the remote user home directory. Also, you have to make sure you did not specify a password when generating the Key pair.

You can actually specify the private key manually in case it's not stored in the expected location. This may vary based on ssh client software.

ssh -vvv -i path/myPrivate.key diskmaster@mydisk 

use -vvv only to see debug messages to help troubleshoot.

I suspect that the key-based authentication is failing and it's falling back to password method. Good luck troubleshooting.