:doc:`Transfer <../../transfer>` / Client / import_ssh_public_key

*********************
import_ssh_public_key
*********************



.. py:method:: Transfer.Client.import_ssh_public_key(**kwargs)

  

  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 <https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ImportSshPublicKey>`_  


  **Request Syntax**
  ::

    response = client.import_ssh_public_key(
        ServerId='string',
        SshPublicKeyBody='string',
        UserName='string'
    )
    
  :type ServerId: string
  :param ServerId: **[REQUIRED]** 

    A system-assigned unique identifier for a server.

    

  
  :type SshPublicKeyBody: string
  :param SshPublicKeyBody: **[REQUIRED]** 

    The public key portion of an SSH key pair.

     

    Transfer Family accepts RSA, ECDSA, and ED25519 keys.

    

  
  :type UserName: string
  :param UserName: **[REQUIRED]** 

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

    

  
  
  :rtype: 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**
  
  *   :py:class:`Transfer.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Transfer.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Transfer.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Transfer.Client.exceptions.InternalServiceError`

  
  *   :py:class:`Transfer.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Transfer.Client.exceptions.ResourceExistsException`

  