Transfer / Client / import_ssh_public_key

import_ssh_public_key#

Transfer.Client.import_ssh_public_key(**kwargs)#

Adds a Secure Shell (SSH) public key to a user account identified by a UserName value assigned to the specific file transfer protocol-enabled server, identified by ServerId.

The response returns the UserName value, the ServerId value, and the name of the SshPublicKeyId.

See also: AWS API Documentation

Request Syntax

response = client.import_ssh_public_key(
    ServerId='string',
    SshPublicKeyBody='string',
    UserName='string'
)
Parameters:
  • ServerId (string) –

    [REQUIRED]

    A system-assigned unique identifier for a server.

  • SshPublicKeyBody (string) –

    [REQUIRED]

    The public key portion of an SSH key pair.

    Transfer Family accepts RSA, ECDSA, and ED25519 keys.

  • UserName (string) –

    [REQUIRED]

    The name of the user account that is assigned to one or more servers.

Return type:

dict

Returns:

Response Syntax

{
    'ServerId': 'string',
    'SshPublicKeyId': 'string',
    'UserName': 'string'
}

Response Structure

  • (dict) –

    Identifies the user, the server they belong to, and the identifier of the SSH public key associated with that user. A user can have more than one key on each server that they are associated with.

    • ServerId (string) –

      A system-assigned unique identifier for a server.

    • SshPublicKeyId (string) –

      The name given to a public key by the system that was imported.

    • UserName (string) –

      A user name assigned to the ServerID value that you specified.

Exceptions

  • Transfer.Client.exceptions.ServiceUnavailableException

  • Transfer.Client.exceptions.InternalServiceError

  • Transfer.Client.exceptions.InvalidRequestException

  • Transfer.Client.exceptions.ResourceExistsException

  • Transfer.Client.exceptions.ResourceNotFoundException

  • Transfer.Client.exceptions.ThrottlingException