New cgit/gitolite not allowing access to copied repostiory - gitolite

Is there any way to get a log of what failed during cloning?
But cloning my copied repository is denied:
$ git clone git#192.168.8.20:linux linux-999
Cloning into 'linux-999'...
FATAL: R any linux user1 DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
The gitolite.conf file:
...
repo testing
RW+ = #all
repo linux
RW+ = #all
The repositories on the server are all owned by the gitolite user.

I figured it out. I hadn't run:
gitolite setup

Related

Git clone with ssh works in Linux but not in Windows PowerShell

I have a repo at GitHub. When cloning it in Linux using ssh it works fine:
> git clone git#github.com:henrikppersson74/frokenjennnie.git
Cloning into 'frokenjennnie'...
Enter passphrase for key '/home/----/.ssh/id_rsa':
.
.
Reinitialized existing Git repository in /home/*
When doing the same thing in Windows PowerShell it doesn't work:
> git clone git#github.com:henrikppersson74/frokenjennnie.git
Cloning into 'frokenjennnie'...
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.
I have copied my private and public SSH keys from Linux to my Windows machine and they are stored in my ~/.ssh/ as id_rsa and id_rsa.pub.
It seems to work when I try to access github.com with ssh from PowerShell:
> ssh git#github.com
Enter passphrase for key 'C:\Users\-----/\.ssh\id_rsa':
PTY allocation request failed on channel 0
Hi henrikppersson74! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
This is the same answer I get when doing this in Linux. I guess this means the my SSH-key par is ok?
When working in Eclipse in Windows, using the "Git Repositories" view it works fine to clone the same repo.
Previously I created new SSH keys in the PowerShell and copied the public one to GitHub, but with the same result.
My ~/.ssh/config file lookes like this:
Host github.com
HostName github.com
IdentityFile ~\.ssh\id_rsa
User git
ForwardAgent yes
I am using Git version:
> git --version
git version 2.28.0.windows.1
Unfortunately I get no extra information from using the --verbose flag:
> git clone git#github.com:henrikppersson74/frokenjennnie.git --verbose
Cloning into 'frokenjennnie'...
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.
It doesn't help to add the key to the ssh-agent:
> ssh-add C:\Users\-----\.ssh\id_rsa
Enter passphrase for C:\Users\-----\.ssh\id_rsa:
Identity added: C:\Users\------\.ssh\id_rsa (C:\Users\-----\.ssh\id_rsa)
> git clone git#github.com:henrikppersson74/frokenjennnie.git --verbose
Cloning into 'frokenjennnie'...
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.
Could my old keys be cashed somewhere?
Does anyone have any idea about why I am not able to clone my repo in Windows PowerShell? I would be so grateful for some help.
The problem was that my %HOME% environment variable was set to the wrong location. When I changed it back to C:\Users\<userid> it worked like charm. Apparently SSH first looks for a key in %HOME%\.ssh\, then for en entry in %HOME%\.ssh\config\ and last it uses the keys added to the ssh-agent.

gitolite FATAL: R any gitolite-admin git DENIED by fallthru

.ssh/config
host git-server
user git
hostname 127.0.0.1
identityfile ~/.ssh/git
port 6827
run: git ls-remote git-server:gitolite-admin.git
error: FATAL: R any gitolite-admin git DENIED by fallthru (or you
mis-spelled the reponame) fatal: Could not read from remote
repository.
Please make sure you have the correct access rights
Simply try first ssh git#host info
[That will] tells you what version of gitolite and git are on the server, and what repositories you have access to.
That is better than ssh to the server, which a regular user could not do anyway, because their SSH public key is associated to a gitolite "force command": they cannot get an interactive session.
Note that for accessing the gitolite-admin.git main configuration repository, you need to use the key that you had when doing the gitolite installation

Gitlab: While cloning a repo via ssh it keeps asking for password

I have installed gitlab on LINUX(RHEL 6.7). While cloning the repo via ssh it keeps asking for the password for git, however it is working fine by using http:
$ git clone http://MGJV67#il06epclin1.am.mot-solutions.com/MGJV67/NewPROJ.git
Cloning into 'NewPROJ'...
warning: You appear to have cloned an empty repository.
mgjv67#mgjv67-430 MINGW64 /c/TCS/Gitlab/NewPROJ (master)
$ git clone git#il06epclin1.am.mot-solutions.com:MGJV67/NewPROJ.git
Cloning into 'NewPROJ'...
git#il06epclin1.am.mot-solutions.com's password:
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
While you can clone anonymously over http, you can only clone over SSH with a valid SSH identity.
Create an SSH key and add the public key to your Gitlab user account, or add it as a deploy key for your project in case you only need read-only access.

git clone using ssh failed in Windows due to permission issue

I have created a new GIT repository in my server at /home/myuser/.git/project.git.
I found ssh key for git from C:\Users\Toshiba\.ssh\github_rsa.pub & appended with server's authorized_keys file.
when i try to do git clone using ssh it fails as below.
$ git clone ssh://myuser#mysite.net:2888/home/myuser/.git/project.git
Cloning into 'project'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could you please help me in resolving this issue.
If your public/private key doesn't have the standard name C:\Users\Toshiba\.ssh\id_rsa(.pub), but C:\Users\Toshiba\.ssh\github_rsa.pub, then you need an ssh config file
Host mysite
Hostname mysite.net
User myuser
Port 2888
IdentityFile C:\Users\Toshiba\.ssh\github_rsa.pub
That would allow you to do
git clone mysite:/home/myuser/.git/project.git
Test it first wih ssh -Tvvv mysite, and then ssh mysite ls.
Make sure the environment variable %HOME% is defined to C:\Users\Toshiba
You have another example in "SSH error on push to an existing project Permission denied (publickey)"

Unable to clone repository to jenkins on linux

I am able to clone a repository that i've created for one of my jobs on jenkins. Whereas, cloning a repository which is a fork of another repository gives the following error when trying to build it - Any suggestions on what could be the problem?
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/client1/workspace
Checkout:workspace / /var/lib/jenkins/jobs/client1/workspace - hudson.remoting.LocalChannel#1d5cac4
Using strategy: Default
Cloning the remote Git repository
Cloning repository https://..... (couldn't disclose the address link here)
git --version
git version 1.7.9.5
ERROR: Error cloning remote repo 'origin' : Could not clone https://.....
hudson.plugins.git.GitException: Could not clone https://......
at hudson.plugins.git.GitAPI.clone(GitAPI.java:273)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
at hudson.FilePath.act(FilePath.java:865)
at hudson.FilePath.act(FilePath.java:838)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:986)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1142)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1331)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:682)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:587)
at hudson.model.Run.execute(Run.java:1557)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
My first guess would be that the user jenkins is running as does not have permission to access the git repo.
I would try logging into the server and running
sudo su <jenkins_user_name>
git clone https://.....
You may just need to add the server to your known hosts if the SSH Keys are already setup.

Resources