I want to run an automatic deploy script on my machine. This is some personal pet projects and want to avoid the bulk of learning and using dedicated software for that, that's why I just want to automate the 2-3 commands I was doing by hand so far.
rsync -r folder login@distant:~
ssh login@distant
### should su here ###
cp folder /var/www
And this is where I'm stuck. I want to get su access to put the files in /var/www. Do I have other solution but to grant write access to /var/www ? If not, how can I get root access after ssh in my script ?