I have a synology nas, that i installed git-server on, and i remember adding a really long key to something, via ssh, now i have a new laptop, and i want to add this key, but i can not find a guide on how to do it, it is very annoying, because i found it the first time, but now i just can't seem to get to the right combination of search terms, and i completely forgot how to do this, i only remember adding the long key, and then vscode was just authorized
#Synology git server ssh key?
1 messages · Page 1 of 1 (latest)
Dunno synology so take it with a grain of salt but default location for public keys on linux servers is typically ~/.ssh/authorized_keys you can use ssh-keygen to generate a new keypair private/public key, the private key stays on the client machine the public key file has the string of randomized text you put in the ~/.ssh/authorized_keys on the synology/server side
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent < even if not using git maybe worth checking out git instructions on setup since making the key is the same, then just put pub key on ssh-server side and should be gtg, SSH client will use the ~/.ssh/id_rsa or other keys that have been registered with the agent when authenticating/connecting
simple command for adding a key to a authorized keys file on the NAS too:
echo "putYourPublickeyContentsInHere" >> ~/.ssh/authorized_keys
^^ this will append the key contents to the end of the text file private key file should stay on the client machine never copy it anywhere (is effectively your "password" can also additionally use password+key for greater security so someone needs to steal the file and know the password to use it)
Oh heh ignore the part about not using git brain was stuck on the ssh part 😄 but yea make keys make sure key agent program has key loaded and pub key is on server authorized keys and should be good
If fails try ssh with -vvvvv verbose flags to get details of what happened, look for what keys used etc, -i flag with ssh can be used to point at specific private key to use as well but if registered with the agent shouldn't need it