Synology DSM root password for ssh

After upgrading to the latest DSM (4.0-2228) version, I’ve found out that I was unable to login as the user root by connecting through ssh.

Enabling and disabling ssh on the control panel and changing the admin password on the Synology Web Interface had no effect.

I even tried to use the known password for the root user to logon, but that also failed.

So the solution?

  1. Enable telnet on the DSM Control Panel.
  2. Connect to the NAS using Telnet and login as root. The password should be the same password used by the web interface admin user. If not, change again the admin password.
  3. Execute the following command synouser –setpw root   password_same_as_admin_or_not
    (Note: is dash dash for the setpwd command line option)
  4. Trying now to ssh as root it should succeed with the password gave in the above command
  5. Disable telnet on the DSM Control Panel
  6. Done.

EDIT: For those that have the issue after upgrading to DSM 6.0 ( I haven’t yet upgraded, I always wait at least a month…), the solution is a follow (Thanks to the comment below of ubergard). Please note that I haven’t test it.

After getting the DSM 6.0 upgrade, I’ve become unable to login as root using SSH, even though I’ve been able to do it before the upgrade (DSM 5.5 or something like that).
The solution:
1. SSH to machine as admin user.
2. Enter command “sudo -s” and providing admin password.
3. Enter command “synouser -–setpw root “.
Now I’m able to logon as root using SSH again, and I didn’t have to mess with telnet.

 

20 thoughts on “Synology DSM root password for ssh

  1. Didn’t work for me. I got this response

    Lastest SynoErr=[user_set.c:1157]
    synouser.c:616 SYNOUserSet failed. synoerr=[0x1D00]

    1. Did you access directly to the root account (through telnet) or did you enter as another user and executed the command su to goto root?

      A quick search on google seems to show that a reboot might fix the problem.

  2. OMG ! I spent so much time figuring how I can get the password for root. I am so happy that I found your solution.
    YOU ROCK BRO

    1. It only doesn’t work when using ssh. It works with telnet, an in that case (telnet) the password is the same than the admin (web console) user.

  3. After getting the DSM 6.0 upgrade, I’ve become unable to login as root using SSH, even though I’ve been able to do it before the upgrade (DSM 5.5 or something like that).
    The solution:
    1. SSH to machine as admin user.
    2. Enter command “sudo su” and providing admin password.
    3. Enter command “synouser –setpw root “.
    Now I’m able to logon as root using SSH again, and I didn’t have to mess with telnet.

  4. I tried the solution mentioned for DSM 6.0, but that didn’t seem to work.

    my password had an & in it, and apparently that messed up the synouser command..
    i changed my password (in synology web interface) to one without an & and tried again, and this worked.
    (by the way, this has to be: “synouser -setpw root [password]”

  5. To clarify what freti said above, step 3 of Ubergard’s instructions for DSM 6.0 should be

    3. Enter command “synouser –setpw root [password]”
    (do not use brackets for your actual password)

  6. Doesn’t work for me… able to change root pwd, but access denied when trying to SSH with root, admin works fine, sudo as well, so not blocked, but it seems there’s some policy somewhere denying SSH access for root ??

    1. Hi. That behaviour is by design on Linux based operating systems. One should always logon as a normal user and then sudo to root.
      One can allow root to connect directly by enabling the option PermitRootLogin on the sshd configuration file,

  7. Well after a couple of hours googling I came across your post.
    I followed the steps a user left for the D209 (notzippy) and it seamed to work. Then I tried to login via ssh but the password was still my old one. Anyways I was logged in as root and was able to modify my files unlike before.
    This was with a DS209 running DSM 4.2

    Thanks

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.