Nothing that I have tried so far has worked; every time I try to transfer my file from one of my servers to the other it asks for a password and it always says permission denied (and before you ask I've checked the password many times (maybe there is a different password for the root account)). I'm already pretty sure it's because the file is in root but I don't know how to fix it, the file has to go into. Does any one know how to transfer the file to the root file? Here's the code I'm using (The Ip and computer names have been changed)

scp -r /home/server/EasyRSA-v3.0.6/pki/reqs/client1.req server@

closed as unclear what you're asking by G-Man, Michael Homer, jimmij, Christopher, X Tian Feb 26 at 17:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • If you can't copy /home/server/EasyRSA-v3.0.6/pki/reqs/client1.req to /tmp, then you can't copy it anywhere else. You are probably the wrong user (without permission to read client1.reg). You also don't need the -r flag if you copy one file and omit the leading zeros in the ip address ( – Freddy Feb 16 at 2:38
  • Are you literally typing server@  Is there a user account called server on the system? – G-Man Feb 16 at 4:11
  • 1
    Please show (by adding to question), what the error-message is (Run the command, then paste this and error-message into question). – ctrl-alt-delor Feb 16 at 11:53

You say you've tried everything, but the example you provide is giving a very long path to the file.

The first step is verifying that you can access the file on the source server.

cat /home/server/EasyRSA-v3.0.6/pki/reqs/client1.req > /dev/null

If that fails, you can't transfer it as the user you're logged in right now. If you can change your user to the owner of the file or to root, you will probably have better luck.

The second step is to make sure you can write to the target location

ssh server@ ': > /tmp/client1.req; ls -l /tmp/client1.req'

If you can't write to that location as the target user, you won't be able to copy the file there. If the redirect to the file failed but ls still listed a file, you may need to delete that file before you can copy this new file to that spot. Or maybe you need to give it a new name why you copy it.

Assuming that both of the tests above succeeded, but the scp is still failing, then take a look at the output from

ssh -v /home/server/EasyRSA-v3.0.6/pki/reqs/client1.req server@

If that doesn't show an obvious problem, it may help if you can add the output from that, starting right after it indicated the password was accepted (that is, everything after debug1: Authentication succeeded (password).) to your question as additional information.

Not the answer you're looking for? Browse other questions tagged or ask your own question.