Go to DSM File Station and upload the public key id_rsa.pub to a shared folder, e.g., a shared folder named test.
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
Command
|
Example
|
ssh DSM admin account@DSM IP address -p SSH port number
|
ssh myadmin@10.17.28.75 -p 22
|
Sign in as root
- Sign in to DSM with root privilege via SSH (refer to this article for detailed instructions).
- Run the following command to create a folder named .ssh.
mkdir -p /root/.ssh
- Copy the public key to a new file by running the command below.
cp /volumeX3/test/id_rsa.pub /root/.ssh/authorized_keys
- Run the following command to ensure that everything in the .ssh folder can only be accessed by the root account.
chmod 700 -R ~/.ssh
- Run the following command to ensure the permissions of the .ssh folder and the authorized_keys file are "700", which is equivalent to "rwx------".
ll -R /root | grep 'ssh\|auth'

- Please also make sure the owner and group of authorized_keys is "root". If not, run the following command to edit the permission.
chown root:root /root/.ssh/authorized_keys

- The setup is complete after the steps above. You can now sign in to your DSM via SSH as root without entering its password:2
Command
|
Example
|
ssh root@DSM IP address -p SSH port number
|
ssh root@10.17.28.75 -p 22
|
Sign in as an administrator
- Launch PuTTY on your computer.
- 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
- End the current session and launch PuTTY again.
- At the Session page, enter "DSM admin account@DSM IP address" in the Host Name (or IP address) field, e.g., "bwdsm6@10.17.28.75".
- Enter the SSH port of your DSM in the Port field, e.g., 22.
- Go to Connection > SSH > Auth. Click Browse to upload your private key file for authentication.
- Click Open.

- 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.
Sign in as root
- Launch PuTTY on your computer.
- Sign in to DSM with root privilege via SSH (refer to this article for detailed instructions).
- Run the following command to create a folder named .ssh.
mkdir -p /root/.ssh
- Copy the public key to a new file by running the command below.
cp /volumeX3/test/id_rsa.pub /root/.ssh/authorized_keys
- Run the following command to ensure that everything in the .ssh folder can only be accessed by the root account.
chmod 700 -R ~/.ssh
- Run the following command to ensure the permissions of the .ssh folder and the authorized_keys file are "700", which is equivalent to "rwx------".
ll -R /root | grep 'ssh\|auth'

- Please also make sure the owner and group of authorized_keys is "root". If not, run the following command to edit the permission.
chown root:root /root/.ssh/authorized_keys

- End the current session and launch PuTTY again.
- At the Session page, enter "root@DSM IP address" in the Host Name (or IP address) field, e.g., "root@10.17.28.75".
- Enter the SSH port of your DSM in the Port field, e.g., 22.
- Go to Connection > SSH > Auth. Click Browse to upload your private key file for authentication.
- Click Open.

- The setup is complete after the steps above. You can now sign in to your DSM via SSH as root without entering its password.