This article documents the usage of the Cpanel::SSH::listkeys function in relation to the cPanel interface. This tag can be used inside cPanel pages.
Cpanel::SSH::listkeys
This function lists public or private keys associated with a user.
- pub (string)
-
Whether to display public or private keys (Public = 1, Private = 0 or not present)
- name
-
Name of the public or private key.
- authstatus
-
Whether or not the key has been added to the user's authorized_keys file. (authorized || not authorized)
- authaction
-
Whether to add the key to or remove the key from the user's authorized_keys file. (Authorize || Deauthorize)
- key
-
Public or private key file name.
- mtime
-
Time the key was last modified. Format: UNIX time.
- ctime
-
Time the key was created. Format: UNIX time.
- haspub (Private keys only)
-
Whether or not the private key has a corresponding public key. (Yes = 1, No = 0)
- file
-
Absolute path to the private or public key.
<?cp SSH::listkeys(% % %,name,authstatus,key) types=pub || 'No keys present'>
This example will list the names and authorizaiton status of all public keys for a cPanel user. If no keys are present, it will output ``No keys present''.
Copyright 2007 cPanel Inc.