By using AWS re:Post, you agree to the AWS re:Post Terms of Use

EC2 Instance Connect continues to prompt me for my already SSH authenticated GitHub Repo.

0

Quick question: why is my EC2 Instance Connect asking me to authenticate my my Github repo clone despite the fact that I have:

  1. Created a Public and a Private key on my local machine,
  2. Uploaded this key into my GitHub account
  3. Uploaded this key into my Amazon AWS account
  4. Selected the key pair when creating my Instance
  5. Selected the key pair when creating an instance

Why, when I run the command :git clone https://github.com/**<GitHub Account>**/**<Repo Name>** in my EC2 Instance Connect, can it not see that I have authenticated this already? Why does it decide to continue to prompt me with the following:

Cloning into '<NAME OF REPO>'...
Username for 'https://github.com': 

There is no need for it to do this, so why is it continuing to do it?

2 Answers
0

Hello.

Why not try creating the key on EC2 instead of creating it locally?
After connecting with EC2 Instance Connect, execute the following command as ec2-user.

ssh-keygen -t rsa

When executed, "id_rsa" and "id_rsa.pub" are created in the ".ssh/" directory.
Once created, use the command below to check the contents of the "id_rsa.pub" file and register it on GitHub.

cat .ssh/id_rsa.pub

After registering on GitHub, you can check the connection with the following command.

ssh -T git@github.com

When cloning a GitHub repository, copy the SSH URL.
I think the git command you're running is an HTTPS clone, so it requires a username and password.
a

In the case of SSH authentication, when executing the "git clone" command, the command should be as follows.

git clone git@github.com:test-repo/python_script.git
profile picture
EXPERT
answered 9 months ago
  • So why do I get the "cat: .ssh/id_rsa.pub: No such file or directory" then?

    Why does everything have to be so complicated? Why does nothing work? Why did they have to make cloning the https version of the repository so much more complicated by removing password authenticity? I am so sick to death of ripping my hair out at the bloody time! I could honestly scream!

    I have literally never seen so much utter crap in my entire life? Why does Amazon sell this complete utter garbage?

0

Sooo why is it telling me that

cat: .ssh/id_rsa.pub: No such file or directory

despite successfully creating the .pub file?

No such file or directory exiits

Tell me, why does Amazon offer all these different ways of doing something and none of them work?

Its like being sold a car - how do you normally turn the engine on? Yep, you get your key that came with the car, stick it in the ignition, and you turn on the ignition except that doesn't work. So you come on to a forum who then offer you a different way to start the engine. For instance, you do a dance around the car whilst hopping one one leg and chanting some voodo song that is supposed to awaken the God of Automobiles and was a ritual that originated in some far-away superstitions culture - probably South America - thousands of years ago when these Amazonian Tribes had car issues - they did this ritual of dancing around their cars and apparently their cars started with no issues.. Guess what, that doesn't work either.

So you look in the vehicles manual - oh look at that - they offer another solution: it says that if you twizzle with the volume knob on the vehicles audio system - because apparently you need to adjust volume to the engines liking - engine will start.

Shock, horror, the engine still doesn't turn over.

By why should we have all these different ways of doing something -especially if they don't work in the first place? If you're being sold a car - the way to turn the engine on is my turning on the ignition, just like the way to generate a SSH key is by following the instructions on Amazon, stick it in your GitHub repository and you just might be in danger of dying with a shred of your sanity in tact.

**Secondly: **why is it that the key is being saved to a .pub file except when you open said file, I get an error message that tells me that I cannot open the bloody fine? Who's idea was it that save this as a .pub (Microsoft Publisher) file in the first place?

If I want to generate a authentication key, I should be able to do so without any BS error messages.

So why am I getting them?

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions