-
Notifications
You must be signed in to change notification settings - Fork 2
delete
Neil Fritz edited this page May 30, 2016
·
3 revisions
Hecate's delete sub-command provides the functionality to delete all keys for a specific user, or a specific key for a specific user. The user defaults to the user who originally ran the command. If no host is specified, all keys for a user will be deleted. For security reasons, this command must be run be the same user a key is being deleted for or as root.
usage: hecate delete [-h] [--user USER_NAME] [--host HOST_NAME] [--force]
optional arguments:
-h, --help show this help message and exit
--user USER_NAME, -u USER_NAME
The user to delete the public key for, defaults to
current user
--host HOST_NAME, -uh HOST_NAME
The host to delete the public key for, defaults to
current host, if not specified will completely remove
the user
--force, -f Force the operation, this will suppress the [y/N]
prompt
-
--user
- the user the delete the key for, if not specified defaults to the user who ran the command -
--host
- the host to delete the key for, if not specified deletes all keys for the user -
--force
- suppress the [y/N] prompt asking for confirmation
First, list the current keys for the user - just to make sure they exist
pinky:bin ncfritz$ hecate list --user ncfritz --type keys
Found 2 keys for user ncfritz in Consul
pinky.local test.ncfritz.net
Now, delete the key for test.ncfritz.net
and user ncfritz
pinky:bin ncfritz$ hecate delete --user ncfritz --host test.ncfritz.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This operation is permanent and can cause disruption to user SSH access to systems!
The following keys will be deleted for user ncfritz:
test.ncfritz.net
Confirm delete [y/N]: y
Verify that test.ncfritz.net
is no longer present as a key
pinky:bin ncfritz$ hecate list --user ncfritz --type keys
Found 1 keys for user ncfritz in Consul
pinky.local