VertexAI GCP not allowing me to connect to Github via SSH keeps erroring - github

I have connected my managed notebook to Github using the instructions here
I cloned my repository using the HTTPS url which works fine only issues is it asks me for UN and PW every time I push or pull so I tried to clone the repository using SSH url which failed to work
I then tried these steps here to Switching remote URLs from HTTPS to SSH using
$ git remote set-url origin git#github.com:USERNAME/REPOSITORY.git
this failed to work also with VertexAI basically freezing up disconnecting from the HTTPS and not recognising the SSH
I have added the relevant SSH keys to my account using the instructions here
does anybody have any advice or any solutions
In short I want to be able to connect VertexAI managed notebook to GitHub via SSH to avoid having to re-enter by UN and PW every time I push or pull
I've tried to clone the repository using the SSH url no avail
I've also tried to change the remote repository using
$ git remote set-url origin git#github.com:USERNAME/REPOSITORY.git

Related

Pushing to GitHub without a key

I am using GitHub and C9 on a work computer and but GitHub will stop reading my SSH key after a few hours. IDK if it is because I am using my work computer (job is not currently programming), but is there a way I can push my code without an SSH key
First, check that your remote URL is indeed an ssh one:
cd /path/to/my/local/cloned/repo
git remote -v
If it is (git#github.com:user/repo), check what ssh -Tv git#github.com returns.
If SSH does not work (because SSH port might be blocked at work), switch to an HTTPS URL:
git remote set-url origin https://github.com/user/repo
From there, make sure git config credential.helper does reference an helper (like "manager" on Windows), and you will be prompted for your GitHub account username/password at the first push. After that, your credentials will be cached.

How do I push/pull from Github over openconnect vpn with github ssh auth?

I'm using openconnect in Ubuntu 16.04 LTS to ssh into a remote machine over a vpn. I'm trying to push and pull to/from Github with ssh authentication, but it's not working. When I try to pull or push, it gives the error:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I connect with nomachine, I'm able to push/pull with Github no problem.
I've tried googling many different things, and haven't noticed anything yet in the options for openconnect or ssh that would help.
Any ideas?
The answer was simple: just set the git url to use the https version instead of ssh. You can also then cache the username/pass for https for a while: https://help.github.com/articles/caching-your-github-password-in-git/

Git hub pushing to a forked repo

I'm new to github and I couldn't seem to find a solution to my problem, so bear with me a little.
I'm trying to push changes that I've made to a forked repo via command line on an ec2 ubuntu instance from aws. After making changes to my file, I committed the file I changed and then pushed it over to git:
ubuntu#ip-172-31-33-24:~/bitstarter$ git push origin master
Username for 'https://www.github.com': edasaur
Password for 'https://edasaur#www.github.com':
fatal: Authentication failed
I'm hypothesizing that this might be an issue with the fact that I'm pushing over to a forked repo because when I attempted to commit and push changes over to a repository that I started, it seemed to work. However, I'm at a loss at what to do. When I tested whether my SSH key worked via the command:
ubuntu#ip-172-31-33-24:~/bitstarter$ ssh -T git#github.com
Hi edasaur! You've successfully authenticated, but GitHub does not provide shell access.
Thanks in advance!
First, you are pushing using an https address, so any ssh settings you might have won't have any bearing on the completion of the (https) push.
Second, the right https url you should use is:
https://edasaur#github.com/edasaur/bitstarter.git
(no need for www.github.com)
(I like to put the username in the url: that is one less data to enter when pushing)
That means you can set your url with:
git remote set-url origin https://edasaur#github.com/edasaur/bitstarter.git
Third, double-check your password (and see if there is any special character in it like an '#', which might not be directly supported over an http query)
If nothing works, you can still fallback on ssh url:
git remote set-url origin git#github.com:edasaur/bitstarter.git

GitHub -> 'The remote end hung up unexpectedly'

I am trying to push a project (Calico) to GitHub, and am running into an error. I've successfully logged in via a ssh connection, and received the usual response:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ ssh git#github.com
Enter passphrase for key '/c/Users/Ryan/.ssh/id_rsa':
Hi rossryan! You've successfully authenticated, but GitHub does not provide shel
l access.
Connection to github.com closed.
However, I am still receiving an error when I attempt to push the code:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ git push -u github master
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
Connection abandoned.
fatal: The remote end hung up unexpectedly
I believe I've followed the instructions rather faithfully from the website, substituting 'GitHub' for 'origin' in the right areas (origin is apparently already defined, so I used a different name). I've emailed GitHub about this problem, but have received no response.
Does anyone have any other ideas?
EDIT:
Output from git remote -v:
Ryan#RYANLAPTOP-PC /C/inetpub/wwwroot/Calico (master)
$ git remote -v
github git#github.com:rossryan/Calico.git (fetch)
github git#github.com:rossryan/Calico.git (push)
origin C:/inetpub/wwwroot/Calico/ (fetch)
origin C:/inetpub/wwwroot/Calico/ (push)
git push origin master fails was about that error when using putty (instead of the packaged openssh included with msysgit). I don't think that is your case.
git - Server host key not cached is about that same error, and proposes to establish an ssh connection, which you did (and it didn't propose to add github to your $HOME/ssh/known_hosts file, so this isn't the issue either.
What you need to check is:
why are you pushing to github instead of the default name 'origin' (did you really add a remote (upstream) repo named 'github'?)
What exact address is behind the remote name 'github'. A right address for pushing would be (from GitHub man page on remote):
an ssh URL git#github.com:user/repo.git
or an https URL such like https://user#github.com/user/repo.git

connecting to github through server permission denied (public key)

I am connecting to github through my ftp server. I added the public key generated by my server then tried to connect and it is still giving me "permission denied", I attached a screenshot below.
You cannot just ssh into githubs servers in this way. Github's SSH server allows you to use git through their servers, not shell access. You get "permission denied" because you login with user github instead of git.
After adding your SSH public key to Github (which you've done correctly), just use git with the SSH remote.
If you have not a local repo yet, just use something like:
git clone git#github.com:Bumblebee-Project/Bumblebee.git
Otherwise, add a new remote to your existing git repo:
git add origin git#github.com:Bumblebee-Project/Bumblebee.git
After that, push your local repo with:
git push
See also http://help.github.com/remotes/