By default openssh will denied any root login attempt. However, this can be allowed by modifying /etc/ssh/sshd_config
on the server side.
Make sure this line sets to yes and no commented out:
PermitRootLogin yes
And then reload your sshd.
However, above setup is not a good security practice. Instead use pubkey login.
the config line should be:
PermitRootLogin without-password
.
On source machine genereate key, follow the wizard:
ssh-keygen -t rsa
Above command will create .ssh/id_rsa.pub
and .ssh/id_rsa
containing public and private key pair.
You need to copy .ssh/id_rsa.pub
content into the destination machine /root/.ssh/authorized_keys
. Make the directory and file if its not exist and make sure the ownership of the authorized_keys is 600
.
Now try scp attempt, it will asks for password that you have entered in step 1.