I am using Debian and want to reinstall a backup of personal and configuration files (the entire /home folder of a user) on a new computer.
For some reason I cannot understand, every files of my entire backup has the same permissions : 777 / -rwxrwxrwx. This is way too permissive for some configuration files. For example, the first time I used ssh after reinstalling the backup, I had to do a "chmod 600 ~/.ssh/config" to be able to start ssh.
I really do not know why this happened. I backup with rsync -av with should preserve permissions and my external hard drive is using a ext4 filesystem.
Anyway, I have only this backup and no possibility to make another one (the computer died). I am looking for a way to set files and folder to their default settings (for example I guess .ssh/config file is 600) automatically.
Is there a way to achieve this automatically?