# Access Add Public Key Subcommand

access: Administrators or Managers

Installs a public key for SSH authentication which enables SSH logins and remote command execution without being prompted for a password. You must first generate a key pair (RSA or DSA) which you can generate using the ssh-keygen command included with OpenSSH.

· Only local users can install public keys (not users who gain authorization through directory services group mappings).
· Managers can add keys for any local user.
· Up to 10 users can install public keys; one key per user.
· The maximum supported key length is 4096 bits.

> `access add public key {–k | --keyfile} PUBLIC_KEY_FILE [–u | --user] USER`

Arguments | Description
--- | ---
`{–k | --keyfile}` | Specifies the user's public RSA or DSA key.
`[–u | USER]` | Specifies the user for which this key will be installed. The default is the current user if no user is specified.

Return Codes

Following are the return values for this command:

Code | Numeric Code | Description
--- | --- | ---
NWSE_Success | 0 | Command successfully completed.
NWSE_InvalidUsage | 1 | Invalid usage: bad parameter usage, conflicting options specified.
NWSE_RPCTimeout | 2 | Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.
NWSE_RPCNotConnected | 3 | Unable to connect to the RPC server.
NWSE_InvalidArgument | 4 | One or more arguments were incorrect or invalid.
NWSE_NotFound | 5 | Entity (user, service, file, path, etc.) was not found.
NWSE_NoPermission | 6 | Not authorized to perform this operation.
NWSE_Exist | 19 | A trust relationship is already present for the specified user.
NWSE_LimitExceeded | 26 | Limit has been exceeded.

Related Topics

System Management Commands

Access Command