So, as part of my home lab and the automatic deployment of this blog, Jenkins needs to SSH onto the deployment Raspberry Pi to execute a bash script. Jenkins has been installed using its own username and as it is a service account, the method to generate and copy the ssh-gen keys is different to the standard way for normal linux/ubuntu user accounts.
#Jekins is a service account, so it needs its ssh keys for remote execution to be created differently...#login to jenkins server and switch to jenkins service user accountsudo su -s /bin/bash jenkins#create keys. default location will be /var/lib/jenkins/.ssh/id_rsassh-keygen#copy keys over to destination servercat /var/lib/jenkins/.ssh/id_rsa.pub | ssh ubuntu@DEPLOYMENT_IP_ADDRESS "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"