Search code examples
amazon-ec2amazon-iamaws-opsworksaws-security-group

How to issue public SSH on aws?


Just had this question as I not a developer if the question might sounds or silly please don’t judge.

Basically I created and instance on aws and at the end of the process I was issued private SSH key which says keep it save and don’t share it. Now if I would like to my developers to have access to instance files and do the coding and etc. Do I need to share my private key? Or I need to create public SSH key only for their use? How can i create it? Can I delete it this public key and cancel access to those files after the job completion? Please any help would be very appreciated!!!


Solution

  • One way (since the ssh key you were given can be used on other EC2 instances created from your account) would be for your users to create an ssh key pair and give you their public key. You then add the key to the end of the file ${HOME}/.ssh/authorized_keys. This will give your developers and other users access to only the instances you want them to have access to.

    The best way would be to create an account for each person (on each server you want them to have access to) and add their public key to the ${HOME}/.ssh/authorized_keys file for their account. Then give them sudo access as needed.