To copy folder where owner doesn't have permission to it, you've to change these permissions.
If the folder is restricted even for the owner, there is some reason for it and giving the permissions for everyone else (o
) isn't a good solution (as shown in the first answer).
For folder to be accessed by the owner, it needs to have read (r
) and execute/search bits (X
) set. If you've folders within the folders, each one should follow the same rules. For files only read bit (r
) is enough.
So basically to give the reading permissions to the folder recursively, you've to run:
chmod -vR u+rX folder/
If you're running above command as a user, prefix with sudo
(if you've superuser privileges), otherwise run as root.
If some files within the folder aren't owned by root, change it recursively by:
sudo chown -vR root folder/
Then copy it as usual or use rsync
as follow:
rsync -vuar src/ dst/
For more explanation about above commands, check: man chmod
and man chown
.