Secure SSH with Passphrase and Fingerprint
masterUse an SSH Key Passphrase
If your private key is encrypted, provide the passphrase using the passphrase input.
Verify Host Fingerprint
To prevent man-in-the-middle attacks, verify the host's fingerprint using the fingerprint input. You can obtain the fingerprint for your host using:
ssh <hostname> ssh-keygen -l -f /etc/ssh/ssh_host_<type>_key.pub | cut -d ' ' -f2
- name: SSH key passphrase
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
+ passphrase: ${{ secrets.PASSPHRASE }}
script: |
whoami
ls -al