Issues SSH keys - KeegMitch/Operations-Engineering-group-c GitHub Wiki

Setup SSH Keys

Errors

All the ssh keys work with the correct SSH keys to both the backup and storage servers when testing the ssh commands.

At the moment we are able to access the storage server with ssh to all the servers, but it prompts a password everytime, which affects the crontab part of our scripts, so it won't actually back up unless we put in our password to the storage server, so for now we're automating our scripts to backup. which works fine

Tried to set the Password Authentication to no in the sshd_config file, but when we do that we get a Permission denied (publickey) error, even though we set the permissions correctly. Also ssh-copy-id doesnt work on storage server, so we had to manually copy the public key to the authorized_keys file.

This screenshot is what happens when I try to ssh into the storage server (works fine on the backup server), when the PasswordAuthentication to no in storage:

image

Only thing we can really think of at this point is the version of OpenBSD and OpenSSH on the storage server is newer than the one on the backup server, or it's something to do with ssh-copy-id:

image

image

Solved: Turns out you have to change the ownership of both the .ssh directory and the authorized_keys in order for ssh-copy-id to work

sudo chown group-c:group-c ~/.ssh
sudo chown group-c:group-c ~/.ssh/authorized_keys

Now ssh-copy-id works properly and now I can ssh into the storage server:

image