Transfer / Client / import_ssh_public_key



Adds a Secure Shell (SSH) public key to a Transfer Family user 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) –


    A system-assigned unique identifier for a server.

  • SshPublicKeyBody (string) –


    The public key portion of an SSH key pair.

    Transfer Family accepts RSA, ECDSA, and ED25519 keys.

  • UserName (string) –


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

Return type:



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.


  • Transfer.Client.exceptions.ResourceNotFoundException

  • Transfer.Client.exceptions.InvalidRequestException

  • Transfer.Client.exceptions.ThrottlingException

  • Transfer.Client.exceptions.InternalServiceError

  • Transfer.Client.exceptions.ServiceUnavailableException

  • Transfer.Client.exceptions.ResourceExistsException