A passwordless SSH session connects to a remote machine with a private key instead of an interactive password. The private key stays protected locally or in GitHub Actions secrets; the matching public key belongs in the remote user's authorized_keys file. section 4.1.5
Prepare the connection before an automated workflow uses it:
- Make the private key available and restrict it with chmod 600. section 4.1.5
- Install the public key remotely in ~/.ssh/authorized_keys. section 4.1.5
- Provide an accessible IP address or hostname. section 4.1.5
- Inject the private key into the workflow, configure host-key handling, and run SSH commands against the remote host. section 4.1.5
Installing NGINX from GitHub Actions
A workflow writes the SSH_PRIVATE_KEY secret to ~/.ssh/id_rsa, applies chmod 600, sets StrictHostKeyChecking=no, then uses the instance address to run apt update and apt install nginx -y remotely.
