I downloaded TeamCity 5 and I can see the option for Git under "Edit VCS Root". I have supplied the Clone Url, Branch
Authentication Method: Default Private Key
But when I test the connection I get the following error:
The connection test failed: com.jcraft.jsch.JSchException: UnknownHostKey: github.com. RSA key fingerprint i
Any ideas?
Below that there is a line that says:
Known Hosts Database:
Check the box next to that that says:
Do not check
You can try to connect over HTTP using authentication method "Password" with credentials you use at login page (email/password) instead of specifying SSH key.
Related
I want to make a repository in GitHub for the first time and now it gives me this error
Username for 'https://github.com': ******`enter username here`
Password for 'https://m.erfanpld#github.com': `enter password here`
remote: Permission to MErfanPld/web.git denied to MErfanPld.
fatal: unable to access 'https://github.com/MErfanPld/web.git/': The requested URL returned error: 403
Thank you for your help
There are two ways you can access Github repositories when they are private.
HTTPS
SSH
I recommend the second method, You must create an ssh key using the command below
ssh-keygen
Now You can print Your ssh public key using the command bellow in Linux
cat ~/.ssh/id_rsa.pub
Use this link as a hint to manage your ssh keys.
Finally, you need to add your public ssh key into GitHub, Github explains this here with a picture guide. Now through ssh public key and without the need to log in with a username and password every single time, You can access your private repositories in a secure way.
Best regards
I configured the SSH based authentication as below
Created a public key on my UNIX server
Added the public key on my Bitbucket repository with reading and write privileges (also tried it at account level)
changed the URL from https to SSH at bitbucket and Unix server
verified the URL using and it is displaying SSH URL only
Then Tried to push, but I am getting the below error:
Permission denied (public key). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I have read and write access to the repository
push command
git push -u origin master
Any idea?
You should try:
GIT_SSH_COMMAND="ssh -Tv" git push
You will see what Git is using as an SSH key, and if there are any error messages.
If the error persists, it is possible there is something preventing SSH to operate properly (as in here, when not connected to a VPN)
Using HTTPS, of course, is a workaround:
git remote set-url origin https://git#bitbucket.XXX.com/XXX.com/XXX.git
After discussion, the missing step was to add the private key to the ssh-agent
ssh-add OEDQ_BIT added the private key
Why does this occur? This is a secret gist, and I removed the PII from the block of code below:
user#NT696918742080085 MINGW64 ~/AppData/Roaming/Code/User (master)
$ git push -u origin master
The authenticity of host 'gist.github.com (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])? no
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Check first if your key is properly recognized:
ssh -Tv git#github.com
Then, following "Pushing to gist", double-check your gist SSH URL, or try (with 2FA activated), an HTTPS URL.
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.
This week I set up an new GitLab server. It is running.
Yesterday I forced him to be reachable via HTTPS for secure communication.
In Eclipse I generated an RSA-Key via the preferences.
But if I try to import an Git-Project (git#DOMAIN:GROUP/PROJECT.git) then:
without password filled in, I got the response: Auth fail: Invalid password or missing SSH key.
with my password filled in (but git username), I got the response:
Auth fail: Invalid password or missing SSH key.
with my user & password, I got the response:
Auth fail: Invalid password or missing SSH key.
Via HTTPS I get the response:
cannot open git-upload-pack
Please, what do I don't see?
From my answer from here:
I faced the same issue while migrating my project from github to bitbucket and this is how I resolved it:
Introduction: I will describe the ssh key usage here. A user generates a unique key to connect to remote machines using ssh. So you can create it locally. After, user uploads the keys to the remote machines where want to connect without password and more securely. On Git, the same thing happens, user creates a ssh key and uploads the generated key value to the git system providers like Github or Birbucket. After uploading your unique key, you must configure your development environment to let your git system provider communicate providing security over ssh key.
1) I was using ssh key to push my commits to remote with github in eclipse, the ssh key is set at window -> preferences -> General -> Network Connections -> SSH2 for eclipse (on git pushes, this ssh key is used if set). If you do not have any ssh keys on your machine then follow this article to generate one for you and set it into eclipse at the path above.
2) In your github or bitbucke account, find the screen where you can save your ssh key. For bitbucket, it is at https://bitbucket.org/account/user/[user-name]/ssh-keys/. '[user-name]' here is your user name at bitbucket. Open your 'id_dsa.pub' file (where you generated your ssh key) with a text editor, select all, copy and paste into your github/bitbucket accounts' ssh key addition section and then click add.
3) At eclipse, be sure to use the 'ssh' GIT URI for your project. Go to Window -> Preferences -> Team -> Git -> Configuration, click 'Repository Settings' tab and paste your GIT ssh URI to remote.origin.url.
4) Finally try to push your commits to remote. You mustn't face any errors, if you have please comment under my answer.
Regards...
Recently, I did have similar issues with GitLab but fixed it with:
First, I generated the ssh-rsa by using the MAC-OSX CLI and exported to GitLab. Git CLIs were working but no luck from Eclipse.
Then, I went to Eclipse > Preferences... > General > Network Connections > SSH2, Key Management tab, I regenerated the key from Eclipse but using the "Generate RSA key..." button. It had "RSA-1024" at the end, and exported to GitLab.
https and ssh are two different communication protocols.
If you want to access your GitLab repos with https url, you should use https url:
https://yourLogin#DOMAIN/group/project.git
If you are using git#DOMAIN:GROUP/PROJECT.git, it is an ssh url.
Now: ssh cloning should work provided you have correctly setup your SSH id_rsa and id_rsa.pub in your Eclipse: see EGit SSH configuration.
Make sure:
your private key isn't password protected at first.
your public key (id_rsa.pub) is published on your GitLab profile