I'm backing up my local machine to a remote server.
Because I want to backup the whole local machine, even files that my local user doesn't normally have access to, I'm doing it using sudo, so the command looks like sudo rsync -M--fake-super --other-arguments / me@server:/backup/location
.
This has the problem that ssh tries to use root's ssh config, and certificates, which are obviously not set up. Recently I've started refering to the server by an alias defined in ~/.ssh/config
and the method stopped working correctly.
The question is: Is there a way that I can use the access rights of sudo, but while keeping the ssh configuration of my regular user?