![]() Changing the file permissions restricts read or write access to the new_user. ssh/authorized_keys file permissions to 600. Use the touch command to create the authorized_keys file in the. Changing the permissions restricts access so that only the new_user can read, write, or open the. ssh directory in the new_user home directory: $ mkdir. Note: When you run the sudo su - new_user command, the name at the top of the command shell prompt changes to reflect the new user account context of your shell session.Ĥ. Change the security context to the new_user account so that folders and files you create have the correct permissions: $ sudo su - new_user Note: If you add the new_user to an Ubuntu instance, then include the -disabled-password option to avoid adding a password to the new account: $ sudo adduser new_user -disabled-passwordģ. Verify that the home directory was created before continuing. ![]() The home directory might not be created by default in some configurations. The following example creates an associated group, home directory, and an entry in the /etc/passwd file of the instance. Use the adduser command to add a new user account to an EC2 instance (replace new_user with the new account name). Connect to your Linux instance using SSH.Ģ. Add a new user to the EC2 Linux instanceġ. For more information, see Error: Unprotected private key file. 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 The private key can have a name that's different from the public key name, but for ease of use, use the same name. output text > my-key-pair.pem saves the private key material in a file with the specified extension. query "KeyMaterial" prints the private key material to the output. If you don't include the -key-format parameter, a pem file is created by default. Note that ED25519 keys aren't supported for Windows instances.įor -key-format, specify pem or ppk. 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) 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |