AWS-CPP-SDK download from git fails - aws-sdk-cpp

I'd like to install the c++ sdk on my ec2 instance. The bash command to do this is given on this page: https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html
"To build the SDK from source"
...
"Clone with Git: git clone git#github.com:aws/aws-sdk-cpp.git"
I downloaded git on my instance and tried this command and get these errors:
"The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists."
If I can't resolve this, then I need to do a direct download. Can I do a Direct download via curl? I'd like to be able to get a fresh download every time I launch a new instance so that I pick up all the new code updates.

The given download(checkout)instruction is based on the assumption that you are using ssh to access Github. You should set up ssh key on Github to make that work.
Otherwise, you can use Https to check it out: git clone https://github.com/aws/aws-sdk-cpp.git

Related

Error in the checkout of a Github using Subversion with SSH - Linux Command line

Github recently enforced a no password rule with their repository access. I can't do two factor authentication, so, I am stuck with SSH keys. I want to use subversion, but when I try to checkout my repo, using:
svn co "svn+ssh://git#github.com/Oiubrab/ozzymandais.git"
I get the error:
Invalid command: 'git#github.com svnserve -t'
You appear to be using ssh to clone a git:// URL.
Make sure your core.gitProxy config option and the
GIT_PROXY_COMMAND environment variable are NOT set.
svn: E170013: Unable to connect to a repository at URL 'svn+ssh://git#github.com/Oiubrab/ozzymandais.git'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
From the research I've done, I think I need to edit the /home/user/.subversion/config file, but i have no idea how and there is no documentation as to how to use svn with github with ssh. I have setup an ssh key and popped it on my github account. I just need to know how to setup the subversion tunnel to github.
I don't think that github supports the svnserve protocol.
AFAIK, you should generate a personal access token (PAT) in GitHub and use it as a password in the Subversion client. I.e., enter your PAT when the client prompts you for a password.

Github SSH issue 'Permission Denied'

I am stuck on this annoying (and common) issue running Manjaro (latest). SSH works just fine for me on my local network. I can connect to my file server and pi-hole just fine.
GitHub however is proving more difficult.
gh repo clone User/Reponame gives the following:
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Cloning into 'Reponame'...
warning: templates not found /usr/share/git-core/templates
The authenticity of host 'github.com (140.82.121.3)' can't be established.
RSA key fingerprint is SHA256:SomeLongNumberBlahBlah.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/USER/.ssh/known_hosts).
Load key "/home/USER/.ssh/id_rsa": Permission denied
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
exit status 128
Now I tried deleting my known_hosts, checking the file permission, creating new keys for my server/pi-hole and all works fine. I don't see why GH is struggling with permission. I've tried a few solutions but nothing seems to work for me. I've set my global user and email for github, I just can't get passed this step.
ssh -T git#github.com Asked for a passphrase and accepted it when I entered. Yay! I have both keys set and added to github.com via my browser etc. I must be missing something.
Still no change in the clone command. I am honestly stuck having read multiple threads on the subject. SSH always gets me :(

How do I provide SSH keys to GitHub Actions so that pip can install from a git repo? [duplicate]

This question already has answers here:
Git error: "Host Key Verification Failed" when connecting to remote repository
(30 answers)
Closed 1 year ago.
I'd like to pip install a library from a private GitHub repository in a GitHub Actions job. I can install it on my computer just fine because I've configured GitHub to accept the SSH key. But how do I give an SSH key to a GitHub Actions runner?
On my computer, this works fine:
python -m pip install "git+ssh://git#github.com/ORG/LIBRARY.git#main#egg=SOMETHING&subdirectory=SOMETHING"
Collecting LIBRARY
Cloning ssh://****#github.com/ORG/LIBRARY.git (to revision main) to /tmp/pip-install-_kw52ce5/LIBRARY_35c4fb5cf6a64e30914beaec4a768bd1
Installing build dependencies ... done
...
Successfully built LIBRARY-0.1.1
I changed the name of the library, organization, and directories for privacy. Documentation for pip installations from GitHub repos are here.
I have tried this guide with this GitHub action with no luck. In GitHub Actions, I get this error message:
Step 15/20 : RUN pip install -r requirements.txt
---> Running in 5ece3eb6572e
Collecting LIBRARY# git+ssh://git#github.com/ORG/LIBRARY.git#main#egg=SOMETHING&subdirectory=SOMETHING
Cloning ssh://****#github.com/ORG/LIBRARY.git (to revision main) to /tmp/pip-install-ohx86p2h/LIBRARY_2972ab1296ce45afa73bbb3c5a036bd1
Running command git clone -q 'ssh://****#github.com/ORG/LIBRARY.git' /tmp/pip-install-ohx86p2h/LIBRARY_2972ab1296ce45afa73bbb3c5a036bd1
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How do I give an SSH key to a GitHub Actions runner?
I think the "Host key verification failed" points to an issue with the ~/.ssh/known_hosts file. Typically, the first time you connect to a host via ssh you are prompted with something similar to:
The authenticity of host 'domain.com (a.b.c.d)' can't be established.
RSA key fingerprint is XX:XX:...:XX.
Are you sure you want to continue connecting (yes/no)?
When you answer yes, the host key is automatically added to the known_hosts file. You can manually add the host key to the known_hosts file of the user that is running your Github Actions:
Get the host key directly from a github admin or once logged into github.com (more secure - highly suggest).
use ssh-keyscan -H github.com >> ~/.ssh/known_hosts

Cannot use git to clone in remote web server

I have created a Github repo to where I push my local changes using Git Bash, without any problems. I can also use Git Bash to connect to my remote web server (shared hosting) and navigate to the folder where I want to clone my Laravel site.
This is where the problems begin. When I do
$ git clone git#github.com:myusername/mylaravelsite.git
I get the error message:
Permission denied (publickey)
After some searching for a solution I found that I should make sure that I have a key by doing this:
$ eval "$(ssh-agent -s)"
Which gave this answer:
Agent pid 122372
Then according to the instructions I should do this
$ ssh-add -l
Which gave me this message:
The agent has no identities
Reading up a bit more I try to add the key again by doing
$ssh-keygen -t rsa
...which generated a key pair that I added with ssh-add, I was prompted for a passphrase which I entered twice.
Now, I still get Permission denied (publickey) when I try to access my github repo with ssh. I should also mention that I have created a new SSH key at the github account where I pasted the key I created (I opened .ssh/id_rsa-pub with notepad and copied the content).
What more can I try?
Finally found the answer in case anyone else has the same problem. It turns out that the public key also must exist in the remote web server (in the .ssh folder I uploaded the same rsa_id and rsa_id.pub files, that I created locally), not only locally and in the Github account.
Once I had figured that out and uploaded those files to the webserver, it worked to clone my github repo :-).

Permission denied to new ssh user when pushing

I'm using terminal, I want to delete ssh keys from and old user (old_username) and set a new one (new_username). I have done as is in this tutorial.
When I run: ssh -T git#github.com I get the correct message:
`Hi new_username! You've successfully authenticated'.
But when I try to push a repository I get denied:
remote: Permission to new_username/test2.git denied to old_username.
fatal: unable to access 'https://github.com/new_username/test2/': The requested URL returned error: 403
I've tried deleting .ssh folder and setting again ssh, but the problem persists.
Using an https url means your ssh connection is not used. At all.
Try switching to ssh:
git clone git#github.com:new_username/test2
That will actually use your ssh credentials, meaning your public and private keys stored in ~/.shh/id_rsa(.pub).
If on Linux or OSX, check a file called ~/.netrc, which contains username/password information that most apps will use when connecting to remote servers. Yes, it even affects git via the https protocol. If you're using a frontend to connect to github, you probably need to clear its preferences so it stops trying to use the old username.