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
- First connect to your nas as root via ssh using your admin password.
- 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/ - Go to or create the directory .ssh
mkdir .ssh cd .ssh/
- Open the file authorized_keys (assuming nano is installed with ipkg, otherwise use cat or vi) :
nano authorized_keys - Copy your public key inside the file and save it.
- Open sshd config file :
nano /etc/ssh/sshd_config - Ensure the two following parameters are enabled and uncommented :
RSAAuthentication yes
PubkeyAuthentication yes
- Configure your ssh client to use your private key and enjoy ;)
Comments