I have a little website which serves a pdf file using nginx. I change the file once a week and I need it to sync with the file that's on the server. My approach was using scp (ssh), however, I can only upload the file into admin's home directory, while it requires to be put into /var/www. Is there any practical and safe way of doing it? I thought about setting up a cron job that'd just copy it from home to /var/www, but I'm concerned whether it's safe to do so or whether it's considered to be a "bad practice". What would be your suggestion?
Asked
Active
Viewed 115 times
0
-
1*Why* can't you scp straight to `/var/www/`? – vidarlo Apr 03 '22 at 15:25
-
root can copy anywhere, so why you cant do it? – djdomi Apr 03 '22 at 18:08
-
I can't access root with SSH, it's possible only with sudo, but afaik, scp can't use sudo command. – Frogieder Apr 05 '22 at 15:31
-
Change permissions or add user to an appropriate group? – vidarlo Apr 10 '22 at 21:29