My Synology is upgraded to DSM 7 somewhere in june and I was running openHAB on it. All broke down so I have to rebuild my complete openHAB environment.
To help me out I updated my connection to the NAS with key authentication, just because it is all private network and that’s save too.
What I did is:
I created both public and private key by
ssh my_syno_username@my_syno_server -p not_on_22
sudo vi /etc/ssh/sshd_config
Removed the # from these lines
#RSAAuthentication yes
#PubkeyAuthentication yes
On the NAS I created the key pair, since windows has the problem of adding CRLF instead of the LF only, what gives problems on unix and ssh.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
just let the standard id_rsa been created in my home folder and then moved it to my home folder by executing:
cd ~
mkdir .ssh
chmod 700 .ssh
mv ~/id_rsa.pub authorized_keys
chmod 600 authorized_keys
Downloaded the id_rsa to my windows download, opened a cmd shell and used
cd UsersxxxxxDownloads
ssh-add id_rsa
Used a PassPhrase with both the key generation and the add.
I opened a new cmd and with ssh my_syno_username@my_syno_server -p not_on_22
SUCCESS, I was logged in after the acceptance of the ssh key.
Then the first thing I did was sudo -i
, the password for root was requested and “Sorry, try again”
I logged in with my ssh admin@my_syno_server -p not_on_22
. Had to use my password and sudo -i
works as a charm.
Since that moment I’m scanning for days the internet trying to find solutions. Tried several, but none worked sofar. So I’m almost there, but what did I miss to do. Please help.