Kategorier
Synology

Synology DSM 6.0 Root Access

UPDATED – UPDATED – UPDATED

PLEASE READ THE STEP BY STEP GUIDE (THE UPDATE)

Simple step by step guide to getting Root Access on a Synology DiskStation

I’ve read this article, and decided to save the text – just to be sure.

http://www.mauchle.name/blog/?p=239

What I did was this:

Getting root access to the Synology after the DSM 6.0 update is solved by doing this.

If you get the WinScp, then you alse get the PuTTY and PuTTYgen.

I’ve used the Config File Editor as explained.

Afterwards I logged into WinScp and used the private key under Advanced–SSH—Authentication.

You’ve of course chosen a very difficult admin/root password for your Synology diskstation – but now everytime you want to connect with Putty you need to type in that long chain of characters, numbers and symbols.

Why not use a a keypair?

    1. Download PuTTY and PuTTYgen (or just get the installer, everything is in there) from here.
    2. Generate a keypair with PuTTYgen (Parameters: SSH-2 RSA)
    3. Save the private key as “myprivatekey.ppk”
    4. Copy the public key to the clipboard. Looks somewhat like this:
      ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAzP4MR3lkCD2pa7nwT3NMjjDBMmEuJ4exW4GKBBP+okArZ/IrjbLIpdh8ahpfgjh8kM//OVUGeRa1GigzcCuGzIa2YfS7L4Q9cbUUWFwIu2hGV3ZpJ2xDZExaaLH90Vw+ZBaozD2OI4FZ1Dqh8Bj29SQqIIbmxf/ASyTmXHZCbQk= rsa-key-20130414
    5. Connect to your diskstation with PuTTY
      diskstation:22
    6. Login as root
    7. Edit the SSH config with
      vi /etc/ssh/sshd_config
    8. Look for the following lines
      #RSAAuthentication yes
      #PubkeyAuthentication yes
      #AuthorizedKeysFile      .ssh/authorized_keys
    9. Change them to this (by hitting “x” when the cursor is over the # and hitting ESC, then typing :wq ENTER)
      #RSAAuthentication yes
      PubkeyAuthentication yes
      AuthorizedKeysFile      .ssh/authorized_keys
    10. Go to /root and create the .ssh folder
      cd /root
      mkdir .ssh
    11. Edit the keyfile
      vi /root/.ssh/authorized_keys
    12. Press “i”
    13. Paste your public key (by right clickking on your mouse) and save the file (Hit Esc, type :wq, hit Enter)
      ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAzP4MR3lkCD2pa7nwT3NMjjDBMmEuJ4exW4GKBBP+okArZ/IrjbLIpdh8ahpfgjh8kM//OVUGeRa1GigzcCuGzIa2YfS7L4Q9cbUUWFwIu2hGV3ZpJ2xDZExaaLH90Vw+ZBaozD2OI4FZ1Dqh8Bj29SQqIIbmxf/ASyTmXHZCbQk= rsa-key-20130414
    14. Set the access-rights to the file
      chmod 700 /root/.ssh
      chmod 644 /root/.ssh/authorized_keys
    15. Disconnect with
      exit
    16. Open Putty again and make the following settings

      Hostname: or
      Port: 22
      Connection type: SSH
      Connection->Data->Auto-login username: root
      Connection->SSH->Auth->Private Key: Your Keyfile
      And save the session as <sessionname>
    17. Create a new shortcut on your desktop with the following target
      "C:\Program Files (x86)\PuTTY\putty.exe" -load "sessionname"
    18. Finished. From now on you can connect by double-clicking.

Written with information from Chainsaw on a Tire Swing

2 kommentarer til “Synology DSM 6.0 Root Access”

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *