How to perform ssh to gitlab - version-control

I am trying to setup the gitlab for my project. I have my ssh key setup in gitlab and I wanted to ssh to my project. I got the ssh link from gitlab
git#git.calculator.com:calculator/engineering.git
However, when I tried to ssh git#git.calculator.com:calculator/engineering.git in my terminal I got
ssh: Could not resolve hostname git#git.calculator.com:calculator/engineering.git: nodename nor servname provided, or not known
I got the ssh link from gitlab and I am not sure why can't I ssh to it. Can anyone help me about this issue? Thanks a lot!

You don't ssh to a full ssh url.
You can check ssh git#git.calculator.com to see if you have (non-interactive probably) ssh access.
But the ssh url mention by GitLab is for cloning (as I mentioned, for instance, in "Can't clone gitlab's repo via ssh, via http - OK"):
git clone git#git.calculator.com:calculator/engineering.git
cd engineering
git log

Related

Github SSH is connected but fails when cloning a repository into Digital ocean droplet

I'm setting up a laravel website with a Digital Ocean droplet.
This process is so difficult and frustrating, I'm losing logic sense...
I'm connected with an ssh key that is connected with github, because I tried this code to test my connection:
ssh -T git#github.com
with this as response:
> Hi (My name)! You've successfully authenticated, but GitHub does not
> provide shell access.
So it is connected.
However, when I want to clone my repository into my online droplet. I get the error:
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.
So I have no idea how to fix this..
My ssh key inside my digital ocean settings is the same as in my github ssh settings.
Any ideas how to fix this?
I've found the solution myself!
So what was the problem?
I was using the ssh key from my localhost as an access key for cloning private github repositories. That is why I couldn't clone into an online service because that online service has it's own specific ssh key. So inside my server, I generated an ssh-key and registered that one on github. When I tried cloning me repo inside my droplet
everything worked as it should do.

ssh -T github.com results in ssh could not resolve hostname github

I am trying to clone my public Git repository using Putty instead of Git Bash. I am doing this over ssh instead of Https(which is the requirement). The Linux machine which i am accessing through putty has IBM OS(Linux on z/os). I have created the rsa keys and added same on Github. While trying to clone my repository , i am getting error as
'ssh-rsa: /usr/lpp/Files/.ssh/id_rsa.pub 1: FSUM7351 not found
fatal: Could not read from remote repository.' although the public key is present.
IBMUSER:/Z21S/usr/lpp/Files/.ssh: >ls
id_rsa id_rsa.pub
When i am trying to issue command ssh -T github.com, i am getting error as ssh could not resolve hostname github
Please suggest.

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/

Cannot connect to GitHub through SSH: host not known

What is the format for SSH URLs in GitHub?
I'm trying with:
ssh git#github.com:Ziiweb/home
but I get
ssh: Could not resolve hostname github.com:Ziiweb/home: Name or service not known
Github is not accessible by SSH, this is protocol used by git for authentication by SSH Keys, so the command is
git clone git#github.com:Ziiweb/home
From GitHub docs Set Up Git:
If you use the SSH repository URL (...), SSH keys are used for authentication.
More: Generating SSH Keys

Is it possible to start jenkins through proxychains

I have code repository on GitHub and CI server (Ubuntu) with Jenkins behind firewall.
So I set proxy settings to jenkins and it works fine (e.g. i can see the availvable plugins).
And I configured proxy settings in .gitconfig.
Also i have id_rsa in jenkins home/.ssh directory.
But jenkins can't perform git clone during job execution because of an error:
ssh: connect to host github.com port 22: Connection timed out
Jenkins user successfully performs proxychains git clone operation in terminal.
Is it possible to force jenkins works through proxychains? Or could anybody advice me some alternatives?
I have solved my problem wih this:
http://blog.paulbetts.org/index.php/2008/04/08/getting-ssh-to-connect-through-a-socks-proxy/
I have solved similar problem using STDIO proxy tunnel.
update ~/.ssh/config:
Host github.com
HostName github.com
User git
ProxyCommand gitproxy %h %p
create ~/bin/gitproxy script with this content:
#!/bin/sh
exec socat STDIO PROXY:proxy.com:$1:$2,proxyport=8080,proxyauth=user:password