From my macOS workstation, I always run the following command once for every Raspberry Pi computer which I control:
ssh-copy-id -i ~/.ssh/id_rsa.pub email@example.com
This assumes that you went through the
openssl steps to generate a public/private key pair and to use the default names. This also assumes that the Pi's hostname is
octopi in this case but you'd need to adjust as necessary. It will prompt once for the
pi user's password which is to be expected. This allows remote connections and commands to run without further need for the
pi user's password from you. Your public key is used to prove that it's you in each case.
Having done this, you can now do remote
ssh commands to run things on the Pi from your workstation and without the authentication password. Similarly, it allows you to run the
scp command remotely to either push/pull files to/from the Pi from your workstation.
Remotely running a script on the Pi from your workstation:
ssh -t firstname.lastname@example.org "~/scripts/run_update"
Remotely pushing a file to the Pi from your workstation:
scp ~/Desktop/somefile.txt email@example.com:~/somedir/.
In this way, you could create something to nicely push file(s) and run commands.
In a similar fashion, the
rsync command is useful for synchronizing from a master copy out to a destination. I have a workstation script I've named
syncit in my path which does a number of things, depending upon the arguments. I've included a command which I use to push an entire folder set over to a particular Pi I use for assembly language testing.
rsync -avz --exclude '.DS_Store' ~/sites/arm/ firstname.lastname@example.org:~/arm
And of course, putting things on a github server and using
git commands would probably be another preferred method.