Skip to content

Send Ssh Public Key

ec2instanceconnect_send_ssh_public_key R Documentation

Pushes an SSH public key to the specified EC2 instance for use by the specified user

Description

Pushes an SSH public key to the specified EC2 instance for use by the specified user. The key remains for 60 seconds. For more information, see Connect to your Linux instance using EC2 Instance Connect in the Amazon EC2 User Guide.

Usage

ec2instanceconnect_send_ssh_public_key(InstanceId, InstanceOSUser,
  SSHPublicKey, AvailabilityZone)

Arguments

InstanceId

[required] The ID of the EC2 instance.

InstanceOSUser

[required] The OS user on the EC2 instance for whom the key can be used to authenticate.

SSHPublicKey

[required] The public key material. To use the public key, you must have the matching private key.

AvailabilityZone

The Availability Zone in which the EC2 instance was launched.

Value

A list with the following syntax:

list(
  RequestId = "string",
  Success = TRUE|FALSE
)

Request syntax

svc$send_ssh_public_key(
  InstanceId = "string",
  InstanceOSUser = "string",
  SSHPublicKey = "string",
  AvailabilityZone = "string"
)

Examples

## Not run: 
# The following example pushes a sample SSH public key to the EC2 instance
# i-abcd1234 in AZ us-west-2b for use by the instance OS user ec2-user.
svc$send_ssh_public_key(
  AvailabilityZone = "us-west-2a",
  InstanceId = "i-abcd1234",
  InstanceOSUser = "ec2-user",
  SSHPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3FlHqj2eqCdrGHuA6d..."
)

## End(Not run)