Synology Nas

From rbachwiki
Revision as of 16:54, 6 February 2023 by Bacchas (talk | contribs)
Jump to navigation Jump to search

How do I sign in to DSM with RSA key pairs via SSH?

Generate Key pair on local computer

  • Sign in to DSM as an administrator.
  • Go to DSM File Station > home.
  • Create an sub-folder named .ssh.
  • Upload the public key id_rsa.pub to the .ssh folder.

Sign in as an administrator

  • Sign in to DSM as an administrator via SSH (refer to this article for detailed instructions, but do not run sudo -i).
  • Run a cd command to switch to the .ssh folder you previously created.
  • cd ~/.ssh
  • Append the public key to a new file by running the command below. There will be two files in the .ssh folder: authorized_keys and id_rsa.pub.
  • cat id_rsa.pub >> authorized_keys
  • The setup is complete after the steps above. You can now sign in to your DSM via SSH using a specified administrator account without entering its password:2
  • ssh DSM admin account@DSM IP address -p SSH port number
  • ssh myadmin@10.17.28.75 -p 22