For security, we recommend the best practice of rotating your SSH keys. Usually, this rotation is specified as a part of a security policy and is implemented in some automated fashion. Depending upon the level of security, for a highly sensitive communication, an SSH key pair might be used only once. Doing this eliminates any risk due to stored keys. However, it is much more common to store SSH credentials for a period of time and set an interval that doesn't place undue burden on users. A time interval of three months is common.
There are two methods used to perform SSH key rotation:
-
On the console, you can upload a new SSH public key and delete an existing SSH public key.
-
Using the API, you can update existing users by using the DeleteSshPublicKey API to delete a user's Secure Shell (SSH) public key and the ImportSshPublicKey API to add a new Secure Shell (SSH) public key to the user's account.
To perform a key rotation in the console
-
Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/
. -
Navigate to the Servers page.
-
Choose the identifier in the Server ID column to see the Server details page.
-
Under Users, select the check box of the user whose SSH public key that you want to rotate, then choose Actions, and then choose Add key to see the Add key page.
or
Choose the username to see the User details page, and then choose Add SSH public key to see the Add key page.
-
Enter the new SSH public key and choose Add key.
Important
The format of the SSH public key depends on the type of key you generated.
-
For RSA keys, the format is
ssh-rsa
.string
-
For ED25519 keys, the format is
ssh-ed25519
.string
-
For ECDSA keys, the key begins with
ecdsa-sha2-nistp256
,ecdsa-sha2-nistp384
, orecdsa-sha2-nistp521
, depending on the size of the key you generated. The beginning string is then followed by
, similar to the other key types.string
You are returned to the User details page, and the new SSH public key that you just entered appears in the SSH public keys section.
-
-
Select the check box of the old you key that you want to delete and then choose Delete.
-
Confirm the deletion operation by entering the word
delete
, and then choose Delete.