Need to create a script at startup that checks if files in $HOME are owned by $USER and -if not- change them.
Would start with find $HOME ! -user $USER and later chown -R $USER:$USER $HOME but can't write it properly to be started automatically as a service at startup in Debian.
This should work.You will probably need to run as
sudo.To execute a command with
findyou can use-execwith the command you want to run.The filename/directory found is inserted into statement as
{}. And when using-execyou have to include a semicolon at the end.If you execute this from a shell script and use
sudobe sure to use$SUDO_USERand/home/$SUDO_USERsince$USERevaluates to root when running a shell script usingsudo