How to Log in to a Synology DiskStation using SSH keys as a user!

in linux •  7 years ago  (edited)

How to Log in to a Synology DiskStation using SSH keys as a user!


Selection_032.jpg

Today we make few steps to setup ssh login with ssh public key as user.
In this tutorial we use user admin as local user for ssh login.

We login from other linux machine to synology to make backup here with rsync.

  1. Create or copy file .ssh

    $ cp -R .ssh /volume1/homes/admin
    $ ls -l /volume1/homes/admin/
    drwx------2 root root 4096 Jan 15 13:11 .ssh

  2. Change owner

    $ chown -R admin.users .ssh
    $ ls -l
    drwx------2 admin users 4096 Jan 15 13:11 .ssh

  3. Change write on files

    $ chmod 750 /volume1/homes/admin/
    $ chmod 700 /volume1/homes/admin/.ssh/
    $ chmod 600 /volume1/homes/admin/.ssh/authorized_keys

  4. Test if it works

    [root@mail ~]# ssh -p 22 [email protected]
    admin@DS115j:~$

Source
NOTE: I’m assuming that you have already generated your SSH keys. How to generate ssh key?


@luciancovaci
If you liked it
Upvote and Follow!
Created on 20170919 at 16:12 EET

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Nice job!

Thank you !

This post has received a 7.74 % upvote from @lovejuice thanks to: @luciancovaci. They have officially sprayed their dank amps all over your post rewards. GOOD TIMES! Vote for Aggroed!

This post has received a 0.77 % upvote from @booster thanks to: @luciancovaci.