![]() If you don't include the -key-type parameter, an rsa key created by default. The name can be up to 255 ASCII characters.įor -key-type, specify rsa or ed25519. pem file.įor -key-name, specify a name for the public key. Use the create-key-pair command to generate the key pair and save the private key to a. Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.ġ. For more information, see Error: Unprotected private key file.Ĭreate a key pair using the AWS Command Line Interface (AWS CLI) The preceding command sets the permissions of your private key file so that only you can read it. If you don't set these permissions, then you can't connect to your instance using this key pair. If you're using an SSH client on a macOS or Linux computer to connect to your Linux instance, then run the following command: chmod 400 key-pair-name.pem Save the private key file in a safe place.ġ0. The file name extension is determined by the file format that you chose. The base file name is the name that you specified as the name of your key pair. The private key file automatically downloads. To add a tag to the public key, choose Add tag, and enter the key and value for the tag. Choose ppk to save the private key in a format that can be used with PuTTY.ħ. Choose pem to save the private key in a format that can be used with OpenSSH. For Private key file format, choose the format to save the private key to. For Key pair type, choose RSA, ED25519.Ħ. A key name can include up to 255 ASCII characters with no leading or trailing spaces.ĥ. Amazon EC2 associates the public key with the name that you specify as the key name. For Name, enter a descriptive name for the key pair. For more information, see Create a key pair using a third-party tool and import the public key to Amazon EC2.Ĭreate a key pair using the Amazon EC2 consoleĤ. If you create your own key pair using a third-party tool, then be sure that your key matches the guidelines.If you create your own key pair using the command line, then follow the recommendations at create-key-pair or New-EC2KeyPair Cmdlet for key type and bit length. ![]() Create a key pair, or use an existing one, for the new user.For more information, see How do I add new user accounts with SSH access to my EC2 instance using cloud-init and user data? Resolution Create a key pair for the new user account You can expedite these steps by using cloud-init and user data. If multiple users require access to the instance, then it's a security best practice to use separate accounts for each user. Every Amazon EC2 Linux instance launches with a default system user account with administrative access to the instance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |