I am working on some hackable virtual machines. For one exercise, I had to transfer a file that I downloaded onto my Linux machine to a Windows machine.

I tried to transfer the filing using pscp through root, but I kept on getting access denied messages even though I was entering the right password. I modified the sshd_config file to PermitRootLogin, set PasswordAuthentication yes, and then I restarted the ssh service, but I still got the access denied message.

Then, I copied the file to a non-root user's home directory on my linux machine, and used pscp to transfer the file to windows through the non-root user, and it worked just fine.

In order to allow the transfer through root, is there anything I should be examining in the sshd_config file other than what I mentioned. Is there anything else that I should be considering to be able to transfer the files through root?

This is not a big deal since I am ultimately able to transfer the files. But, I am just hung up on why it would not work through root.

1 Answer 1


Take a look at sshd_config man page, PermitRootLogin section:

         Specifies whether root can log in using ssh(1).  The argument
         must be yes, prohibit-password, without-password,
         forced-commands-only, or no.  The default is yes.

         If this option is set to prohibit-password or without-password,
         password and keyboard-interactive authentication are disabled for

         If this option is set to forced-commands-only, root login with
         public key authentication will be allowed, but only if the
         command option has been specified (which may be useful for taking
         remote backups even if root login is normally not allowed).  All
         other authentication methods are disabled for root.

         If this option is set to no, root is not allowed to log in.

Probably your file is set to no. Try changing it to yes, restart ssh service and try again.

  • I had already tried that but it did not work
    – pdawg
    Jul 20, 2020 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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