WD Community

[SOLVED] scp permission denied after successful authentication

I read the other posts about people having trouble being able to log in with ssh/scp. This is a different issue, and I’m posting the solution in the hopes that it will save others the hours it took me to figure it out.

First, to be honest, I have no idea which model of My Cloud NAS I own, so sorry if this does not actually apply to the “DL Series”.

On my drive, root’s umask has been set to 0001. What this means is that by default, when root creates a directory (or a file) it leaves off the “other users” x bit, and what that means is that even if you create a subdirectory with permissions of 777 and owned by the user that will be doing the scp, that user will still NOT be able to create anything inside that subdirectory, because the subdirectory’s parent’s lack of “other users x bit” means it will not permit other users to traverse it in order to reach the subdirectory.

So for instance, if root creates a directory called /DataVolume/BACKUPS/ and under BACKUPS creates directories for different users, root must do a chmod o+x (or better chmod o+t) on BACKUPS before the users can write files to their respective directories. Or use the -m option on the mkdir command (eg mkdir -m o+t BACKUPS)

Alternately, I suppose you can “fix” the umask command in root’s .bashrc and set it to the more typical 0022.

Hello,

Thank you for sharing this.

Support for Western Digital Hard Drives | Western Digital

Still Need Help?

Reach out to Support for more assistance.

Sign in to Your Support Account

Get up-to-date information about your products.

Western Digital Business Portal

Unlock benefits and tools for your business such as enterprise support, pricing and rebate tools, marketing, loyalty, rewards, and more.