But why? If you have server access, use it directly. There are plenty of programs which can sync over SCP/SFTP/FTP etc.. directly, no need for some weird PHP shell and custom protocol and 2nd password...
Maybe encryption would partial help solve that, or the rules have changed, but I figured I’d mention it for awareness.