About Running Shell Commands Remotely

You can run commands remotely using the ssh tool as follows:

1
2
scp backup.zip root@1.2.3.4:/var/backups/backup.zip
ssh root@1.2.3.4 chown myproject:www-data /var/backups/backup.zip

That's useful for simple maintenance scripts.

N.B. For security reasons, avoid setting SSH connections with a root user and password. Connections with SSH private and public keys should be OK.

Tips and Tricks Dev Ops Security Maintenance Bash SSH