01 November 2011

Connect to SSH with a Public Key on a Synology Station

Prerequisites :
  • You own a public key and a private key, or you can generate one with puttygen or openssl
  • ipkg and nano installed if you want to use this editor

  1. First connect to your nas as root via ssh using your admin password.
  2. If you want to connect later on as root, go in the home folder of root
    If you want to connect as another user, go in the home folder of the other user, and follow the same instructions
    cd /root/
  3. Go to or create the directory .ssh
    mkdir .ssh
    cd .ssh/
  4. Open the file authorized_keys (assuming nano is installed with ipkg, otherwise use cat or vi) :
    nano authorized_keys
  5. Copy your public key inside the file and save it.
  6. Open sshd config file :
    nano /etc/ssh/sshd_config
  7. Ensure the two following parameters are enabled and uncommented :
    RSAAuthentication yes
    PubkeyAuthentication yes
  8. Configure your ssh client to use your private key and enjoy ;)
Post a Comment