All Forums Teradata Database on AWS
au185006 32 posts Joined 12/12
31 Mar 2016
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

ulrich 816 posts Joined 09/09
04 Apr 2016

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.

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

ac110057 16 posts Joined 07/11
04 Apr 2016

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/
  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/
  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/ >> /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
You must sign in to leave a comment.