I'm getting the following error when trying to create a host: /usr/bin/ssh-copy-id: ERROR: No identities found
I am trying to SSH using a user which is not root. I did generate the ssh identities for both root and the other user and setup some copy/permissions in the go script to persist these identities across reboot.
I am also trying to SSH to another unRAID box with the same configuration.
The .ssh/id_rsa.pub permissions have +r for all.
I also have the RSA key authentication working properly between both boxes.
Any ideas?
How I setup the SSH identities to persist through reboot
Log in as root
Create your SSH identity using the command ssh-keygen ( Your files will generate into /root/.ssh )
If you want to do RSA or PublicKey auth, use ssh-copy-id to/from the server you want to auth to. I have two unraid boxes, so I used this command to send the key to the client machine. You'll get both the authorized_keys and known_hosts files created in your .ssh directory.
Create the folders in /boot/config: /boot/config/user_home
Create the folders in /boot/config/user_home: /boot/config/user_home/root
Copy the files in /root/.ssh/ to /boot/config/user_home/root/.ssh
Add the following to the bottom of the /boot/config/go script:
cp -r /boot/config/user_home/root/.ssh /root/
chmod 500 /root/.ssh/*
chmod 700 /root/.ssh
For non-root users we can copy saved user home directories in their entirely:
cp -r /boot/config/user_home/<user> /home/
chown -R <user> /home/<user>
chmod 500 /home/<user>/.ssh/*
chmod 700 /home/<user>/.ssh
Also, in the /boot/config/ssh/sshd_config file, enable the following two lines:
RSAAuthentication yes
PubkeyAuthentication yes
(I don't think you need RSAauthentication enabled, but i enabled both)
If you have issues, just add the -v flag when you're making an ssh connection ( ssh -v <user>@<host> ). If you're using keys to authenticate and it still prompts you for a password, log in using the password and see what message the server returns to you. I had an issue with the .ssh directory not being set to 700 causing the password prompt. If you setup a password in your key, you'll still be asked for that when logging in.