Cpanel::SSH::listkeys

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.


SYNOPSIS

Cpanel::SSH::listkeys


DESCRIPTION

This function lists public or private keys associated with a user.


VARIABLES

INPUT

pub (string)
Whether to display public or private keys (Public = 1, Private = 0 or not present)

OUTPUT

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.


EXAMPLES

<?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

Copyright 2007 cPanel Inc.