The access key-pairs were created by different teams, and they have stored it somewhere. But it is a tedious task to ask for key-pair everytime a new pair is created. So, I was looking for an alternative. We have root access to the AWS account though. But that only enable aws command not the ansible.
On Tuesday, August 7, 2018 at 1:16:45 AM UTC-5, Karl Auer wrote: > > Can you access the instances at all? Using any account? Does that account > have root access or sudo privileges? > > If so, then you can log in, and authorizze access to any existing account > for any public key of your choice. It dioesn't have to be the one issued by > AWS. > > If you do not have access that lets you do this, then you are out of luck. > The only way forward would be (for each instance): > > - stop the instance > - detach the root volume from the instance > - mount the root volume as an additional volume on another instance > - using root access on the other instance, modify the attached volume: > - add a new user to /home > - add entries to /etc/passwd, /etc/shadow and /etc/group > - make sure the new user has sudo access > - put an appropriate public key in the .ssh/authorized_keys file for > the new user > - detach the volume from the other instance > - reattach the volume to the original instance > - start the original instance > > That's roughly it, anyway. None of it will work if you have encrypted the > volume, or do not have administrative access to the AWS account containing > the instance. > If the instances are being created by an ASG, then you could use the > userdata to get in to new instances. Ask if you need to know how. > > Regards, K. > > > > On Tue, Aug 7, 2018 at 4:01 PM, Ashish Gauli <[email protected] > <javascript:>> wrote: > >> I need to configure all AWS instances using ansible (for example install >> datadog agent), but I do not have key-pairs for each of those instances. Is >> there a way I can enable ansible-ssh without keypair? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/df48e51c-1cd1-4cbc-9b88-844a54a1cc43%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/df48e51c-1cd1-4cbc-9b88-844a54a1cc43%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Karl Auer > > Email : [email protected] <javascript:> > Website: http://2pisoftware.com > > GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816 > Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cf185ab3-1ff1-45de-bab6-450ca881568d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
