threads / discuss / 39796

ssh admin git accidentally deleted

Subject: ssh admin git accidentally deleted

## tl;dr

4 messages between Jul 7, 2015 and Jul 8, 2015.

replies: 3people: 3as markdown or json

agnes retnaningsih· Jul 7, 2015, 13:30 UTC · lore

Dear git , I accidentally delete ssh admin git, unfortunately there just one admin so I can't make a change in the config and push to the repository. If there's a way undo the change or make an existing user become an admin or is there any super admin command?

I use git version 1.7.5.4

Thanks. Best Regard,

Agnes
Konstantin Khomoutov· Jul 7, 2015, 13:47 UTC · re: agnes retnaningsih · lore

Re: ssh admin git accidentally deleted

On Tue, 7 Jul 2015 20:30:59 +0700 agnes retnaningsih <agnes.monest@gmail.com> wrote:

Show 6 quoted lines
> Dear git , I accidentally delete ssh admin git, unfortunately there
> just one admin so I can't make a change in the config and push to the
> repository. If there's a way undo the change or make an existing user
> become an admin or is there any super admin command?
> 
> I use git version 1.7.5.4

Git itself has no concept of users or user access controls. From the description of the problem, it appears you're using Gitolite [1] as a front-end to Git.

I can't unambiguously decode what "delete ssh admin git" means
because to me, it can mean at least two things:
1) You have deleted the SSH account used to push your Gitolite
   configuration on your server.
2) You have deleted the public key of the Gitolite admin user
   from your repository, and pushed.

In the case you have to log into your server (via SSH or other means) first.

Then, in the first case,
1) Re-create the account;
2) Generate another SSH key for it;
3) Take the public part of this key, clone the Gitolite config
   repo locally (on the server), replace the admin's key there
   with the new key, commit, push.
4) Transport the private admin's key to the machine you're
   administering Gitolite from.
In the second case,
1) Clone the Gitolite config repo locally (on the server);
2) Revert the commit which nuked the admin's key (by using the
   regular `git revert` command, commit and push.
Note that this all implies you have enough permissions on your server.
1. https://github.com/sitaramc/gitolite
Fredrik Gustafsson· Jul 7, 2015, 13:49 UTC · re: agnes retnaningsih · lore

Re: ssh admin git accidentally deleted

On Tue, Jul 07, 2015 at 08:30:59PM +0700, agnes retnaningsih wrote:
> Dear git , I accidentally delete ssh admin git, unfortunately there
> just one admin so I can't make a change in the config and push to the
> repository. If there's a way undo the change or make an existing user
> become an admin or is there any super admin command?

Git does not have access control at all. There's no admin in git. You're talking about a hosting solution for git and you're not telling which one you're using. If you want a better answer you need to provide more information.

_Assuming_ you're using gitolite on Linux you can always use the root account on the server to correct any mistakes you did in the gitolite configuration.

> 
> I use git version 1.7.5.4

What's the reason for using a 4 year old version? You're missing a lot of development. It's like using an iPhone 4s today instead of an iPhone 6.

-- 
Fredrik Gustafsson

phone: +46 733-608274
e-mail: iveqy@iveqy.com
website: http://www.iveqy.com
Fredrik Gustafsson· Jul 8, 2015, 05:38 UTC · lore

Re: ssh admin git accidentally deleted

On Wed, Jul 08, 2015 at 12:32:42AM +0700, agnes retnaningsih wrote:
Show 13 quoted lines
> I use gitolite on linux.
> he2nk is account that I delete on server where gitolite-admin is repository
> to change gitolite configuration. I still can make editing such as add user
> to access gitolite-admin  but when I push it, it error ( file attached), I
> think it because the he2nk has been deleted.
> 
> 
> he2nk is ssh that I have deleted and push it to the server.
> 
> 
> So, if there anyway to revert the change I pushed?? so that I can make a
> change on gitolite admin.
> 

So from what I understand he2nk is a gitolite account and not a linux account. And you deleted he2nk from your gitolite-admin repository.

Yes you can revert this and you can also add he2nk again, whatever you like. But as you've seen you can't do this with gitolite. You've to do this directly on the server since you don't have access to edit the gitolite-admin repository (if I guess correct).

Please don't forget to CC the git-list.
-- 
Fredrik Gustafsson

phone: +46 733-608274
e-mail: iveqy@iveqy.com
website: http://www.iveqy.com

← back to recent threads