Skip to main content

Delete

Delete an SSH authorized key.

The agent removes the key with the given SHA256 fingerprint from the ~/.ssh/authorized_keys file of the user.

osapi client node user ssh-key delete

Examples​

osapi client node user ssh-key delete --target web-01 \
--name deploy --fingerprint 'SHA256:abc123...'
osapi client node user ssh-key delete --target _all \
--name deploy --fingerprint 'SHA256:abc123...'

Result​

If it does not find the fingerprint, the command returns changed: false.

Flags​

FlagDescriptionDefault
--fingerprintFingerprint of the SSH key to remove (required)
--nameUsername to remove SSH key from (required)

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file/etc/osapi/osapi.yaml
-T, --targetTarget: _all, _any, hostname, or label (group:web.dev)_all
--urlURL the client will connect tohttp://0.0.0.0:8080

Output tells how the result is printed, and what --json gives.