I have an Ubuntu 16.04 server with SSH, I have configured a keypair so I can SSH on to a remote system with no password, this works fine.
I am trying to SCP from Local (system1) to ther remote (system2), the SCP works fine but asks for a password. I want to use the keypair for non-autheticated copying.
I have followed numerous guides from the web on how to do this, but it basically seems to boils down to the following:
scp -i <path the PRIVATE key file> filetocopy [email protected]:~
Everything I can find on the internet says this should work - but it keeps asking for the password for the remote (2nd) system, even though I know the keypair works OK because I can use it for SSH.
Annoyingly - the same command as above will work perfectly with no password request if run as root - either by way of 'sudo' or from an elevated terminal...
so:
sudo scp -i <path the PRIVATE key file> filetocopy [email protected]:~
Works fine, but:
scp -i <path the PRIVATE key file> filetocopy [email protected]:~
does not.
There are no files in the roots' .ssh folder except for the known_hosts files (i.e. no key files)
What should I do?