How do I create additional key pairs for users?

Teradata Database on AWS
Teradata Employee

How do I create additional key pairs for users?

Can I have more than a single Key pair for users to connect to an instance

2 REPLIES
Senior Supporter

Re: How do I create additional key pairs for users?

Not to my knowledge - once aws keypair is bound to the instance.

But once the system is up and running you can configure the standard ssh keyless access with additional public keys.

Teradata Employee

Re: How do I create additional key pairs for users?


Here are the steps to add a keypair to an existing system

  1. Log on to the system.
  2. From the command line, run the following command to check if a keypair already exists. If it outputs a public key, skip to step 5. Otherwise, proceed to step 3.
    • cat /home/ec2-user/.ssh/id_rsa.pub
  3. Run “ssh-keygen” from the command line to generate a public and a private key
    • When prompted to enter the directory to save the key files, use the default directory by leaving it blank and pressing Enter
    • When prompted for a passphrase, leave it blank and press Enter
  4. Run the following command and verify that the public key is generated
    • cat /home/ec2-user/.ssh/id_rsa.pub
  5. Make a backup of of the file called “authorized_keys” by running the following command
    • cp /home/ec2-user/.ssh/authorized_keys /home/ec2-user/.ssh/authorized_keys.bak
  6. Add the public key to “authorized_keys” by running the following command
    • cat /home/ec2-user/.ssh/id_rsa.pub >> /home/ec2-user/.ssh/authorized_keys
  7. You can either transfer the /home/ec2-user/.ssh/id_rsa file to your PC ,or you can copy the contents of /home/ec2-user/.ssh/id_rsa to a notepad and save the file with .pem extension
    • cat /home/ec2-user/.ssh/id_rsa
  8. You can use the .pem file to SSH into your system using PuTTy or SecureCRT.

  1. Restoring back authorized_keys

    1. After the session is over, you may want to restore the “authorized_keys” file to strengthen your security
    2. Run the following command to restore your “authorized_keys” file
      • cp /home/ec2-user/.ssh/authorized_keys.bak /home/ec2-user/.ssh/authorized_keys