git push/pull with ssh key
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
- I have a 'git --bare' repo on a linux machine.
- I wish to allow another user from a different machine to push/pull to
it. - I have their ssh key.
Is there some way I can allow them to execute the command,
git clone ssh://user@server:/home/user/name.git
At the moment, I simply added their ssh key to my authorised keys... but that's not ideal. Searching around I only find suggestions for either moving to github or having a dedicated server with all the ssh keys for access (neither desirable).
Ideal would be if in the name.git directory I could execute something to add an ssh-key as an authorised pusher/puller,
git add --ssh <key> #not a real command
I'm on GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) with git 1.7.1.
Update: comments about gitolite led me to find this post which part solves my problem by using ssh 'authorized_key file formats' (manual) to allow only git-shell access. ssh-key-user now has access to only git folders, but I have not restricted their access to specific repo(s).
ssh permissions git access-control account-restrictions
add a comment |
- I have a 'git --bare' repo on a linux machine.
- I wish to allow another user from a different machine to push/pull to
it. - I have their ssh key.
Is there some way I can allow them to execute the command,
git clone ssh://user@server:/home/user/name.git
At the moment, I simply added their ssh key to my authorised keys... but that's not ideal. Searching around I only find suggestions for either moving to github or having a dedicated server with all the ssh keys for access (neither desirable).
Ideal would be if in the name.git directory I could execute something to add an ssh-key as an authorised pusher/puller,
git add --ssh <key> #not a real command
I'm on GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) with git 1.7.1.
Update: comments about gitolite led me to find this post which part solves my problem by using ssh 'authorized_key file formats' (manual) to allow only git-shell access. ssh-key-user now has access to only git folders, but I have not restricted their access to specific repo(s).
ssh permissions git access-control account-restrictions
3
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
1
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35
add a comment |
- I have a 'git --bare' repo on a linux machine.
- I wish to allow another user from a different machine to push/pull to
it. - I have their ssh key.
Is there some way I can allow them to execute the command,
git clone ssh://user@server:/home/user/name.git
At the moment, I simply added their ssh key to my authorised keys... but that's not ideal. Searching around I only find suggestions for either moving to github or having a dedicated server with all the ssh keys for access (neither desirable).
Ideal would be if in the name.git directory I could execute something to add an ssh-key as an authorised pusher/puller,
git add --ssh <key> #not a real command
I'm on GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) with git 1.7.1.
Update: comments about gitolite led me to find this post which part solves my problem by using ssh 'authorized_key file formats' (manual) to allow only git-shell access. ssh-key-user now has access to only git folders, but I have not restricted their access to specific repo(s).
ssh permissions git access-control account-restrictions
- I have a 'git --bare' repo on a linux machine.
- I wish to allow another user from a different machine to push/pull to
it. - I have their ssh key.
Is there some way I can allow them to execute the command,
git clone ssh://user@server:/home/user/name.git
At the moment, I simply added their ssh key to my authorised keys... but that's not ideal. Searching around I only find suggestions for either moving to github or having a dedicated server with all the ssh keys for access (neither desirable).
Ideal would be if in the name.git directory I could execute something to add an ssh-key as an authorised pusher/puller,
git add --ssh <key> #not a real command
I'm on GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) with git 1.7.1.
Update: comments about gitolite led me to find this post which part solves my problem by using ssh 'authorized_key file formats' (manual) to allow only git-shell access. ssh-key-user now has access to only git folders, but I have not restricted their access to specific repo(s).
ssh permissions git access-control account-restrictions
ssh permissions git access-control account-restrictions
edited 5 hours ago
Rui F Ribeiro
41.9k1483142
41.9k1483142
asked Mar 10 '16 at 15:22
Sonke HeeSonke Hee
212
212
3
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
1
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35
add a comment |
3
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
1
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35
3
3
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
1
1
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268946%2fgit-push-pull-with-ssh-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268946%2fgit-push-pull-with-ssh-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
I think "gitolite" would be your friend. It uses ssh pubkey auth, has a fairly simle permission-system, and is easily configurable. In fact, you publish keys and premissions by editing the "gitolite-admin" repository, and pushing it to the server. github.com/sitaramc/gitolite.git
– gerhard d.
Mar 10 '16 at 15:50
I simply added their ssh key to my authorised keys Do the user connects through its own account?
– A.L
Mar 11 '16 at 0:39
1
@gerhardd.: Thank you for pointing me to gitolite! It looks very useful, but unfortunately I do not have root access, nor a 'fresh user id' that they mention as important. I still need to maintain my existing .ssh/authorized_keys file. I stumbled across git-shell too, but it seems similar to gitolite as I need to be able to add users to a machine (I think)... rather than just allowing me to provide git clone/push/pull access, for a particular ssh-key, to my git repo on my machine.
– Sonke Hee
Mar 11 '16 at 15:32
@A.L: I believe the user connects from a different machine and does not have an account on the server where my git repo is. My git repo is on a HPC cluster (so I have little admin control) and my colleague would access it from their work computer (which is another cluster, managed by someone else). I hope that answers it, I am not as clear in my head about Linux things as I should be.
– Sonke Hee
Mar 11 '16 at 15:35