Clone git bare repository behind private vpn
I'm working on a basic project under an aws network.
The project use a tipical vpn with a public subnet with an elb that forward traffic to a private subnet where the code resides.
I used to work on the private subnet with a tunnel launched throught putty and then passing files with filezilla. The process works fine.
Now, I want to go a step further and start using git as version controller of my project, I set up an initial repository and a bare repository inside the private subnet.
Then in my local desktop I have to clone the bare repository and start working on the project and push changes to the remote one.
With my tunnel on, I try with:
git clone ssh://private_ip/path/to/bare/repo.git repo
but the bash say:
connect to host private_ip port 22: connection timed out please make sure you have the correct access rights
I try with a combination of access but none seems to work:
git clone ssh://user@public_ip:22/private_ip/path/to/bare/repo.git repo //permission denied (publickey)
git clone ssh://user@private_ip/path/to/bare/repo.git repo //connection timed out
am I missing something? What the correct url to connect to the private subnet under a tunnel? Is there a better way to manage the vcs?
Thank you
git putty amazon-web-services
add a comment |
I'm working on a basic project under an aws network.
The project use a tipical vpn with a public subnet with an elb that forward traffic to a private subnet where the code resides.
I used to work on the private subnet with a tunnel launched throught putty and then passing files with filezilla. The process works fine.
Now, I want to go a step further and start using git as version controller of my project, I set up an initial repository and a bare repository inside the private subnet.
Then in my local desktop I have to clone the bare repository and start working on the project and push changes to the remote one.
With my tunnel on, I try with:
git clone ssh://private_ip/path/to/bare/repo.git repo
but the bash say:
connect to host private_ip port 22: connection timed out please make sure you have the correct access rights
I try with a combination of access but none seems to work:
git clone ssh://user@public_ip:22/private_ip/path/to/bare/repo.git repo //permission denied (publickey)
git clone ssh://user@private_ip/path/to/bare/repo.git repo //connection timed out
am I missing something? What the correct url to connect to the private subnet under a tunnel? Is there a better way to manage the vcs?
Thank you
git putty amazon-web-services
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
using the same username?
– Algeriassic
Jan 29 at 14:41
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01
add a comment |
I'm working on a basic project under an aws network.
The project use a tipical vpn with a public subnet with an elb that forward traffic to a private subnet where the code resides.
I used to work on the private subnet with a tunnel launched throught putty and then passing files with filezilla. The process works fine.
Now, I want to go a step further and start using git as version controller of my project, I set up an initial repository and a bare repository inside the private subnet.
Then in my local desktop I have to clone the bare repository and start working on the project and push changes to the remote one.
With my tunnel on, I try with:
git clone ssh://private_ip/path/to/bare/repo.git repo
but the bash say:
connect to host private_ip port 22: connection timed out please make sure you have the correct access rights
I try with a combination of access but none seems to work:
git clone ssh://user@public_ip:22/private_ip/path/to/bare/repo.git repo //permission denied (publickey)
git clone ssh://user@private_ip/path/to/bare/repo.git repo //connection timed out
am I missing something? What the correct url to connect to the private subnet under a tunnel? Is there a better way to manage the vcs?
Thank you
git putty amazon-web-services
I'm working on a basic project under an aws network.
The project use a tipical vpn with a public subnet with an elb that forward traffic to a private subnet where the code resides.
I used to work on the private subnet with a tunnel launched throught putty and then passing files with filezilla. The process works fine.
Now, I want to go a step further and start using git as version controller of my project, I set up an initial repository and a bare repository inside the private subnet.
Then in my local desktop I have to clone the bare repository and start working on the project and push changes to the remote one.
With my tunnel on, I try with:
git clone ssh://private_ip/path/to/bare/repo.git repo
but the bash say:
connect to host private_ip port 22: connection timed out please make sure you have the correct access rights
I try with a combination of access but none seems to work:
git clone ssh://user@public_ip:22/private_ip/path/to/bare/repo.git repo //permission denied (publickey)
git clone ssh://user@private_ip/path/to/bare/repo.git repo //connection timed out
am I missing something? What the correct url to connect to the private subnet under a tunnel? Is there a better way to manage the vcs?
Thank you
git putty amazon-web-services
git putty amazon-web-services
asked Jan 25 at 18:23
MindexperimentMindexperiment
111
111
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
using the same username?
– Algeriassic
Jan 29 at 14:41
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01
add a comment |
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
using the same username?
– Algeriassic
Jan 29 at 14:41
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
using the same username?
– Algeriassic
Jan 29 at 14:41
using the same username?
– Algeriassic
Jan 29 at 14:41
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01
add a comment |
1 Answer
1
active
oldest
votes
If you are listening on port 3333
and forwarding to private_ip:22
, you need to use your localhost
with the port you are listening on:
git clone ssh://user@localhost:3333/path/to/bare/repo.git repo
PS: Make sure your user has SSH access to the private_ip
host
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
|
show 1 more comment
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f1398511%2fclone-git-bare-repository-behind-private-vpn%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are listening on port 3333
and forwarding to private_ip:22
, you need to use your localhost
with the port you are listening on:
git clone ssh://user@localhost:3333/path/to/bare/repo.git repo
PS: Make sure your user has SSH access to the private_ip
host
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
|
show 1 more comment
If you are listening on port 3333
and forwarding to private_ip:22
, you need to use your localhost
with the port you are listening on:
git clone ssh://user@localhost:3333/path/to/bare/repo.git repo
PS: Make sure your user has SSH access to the private_ip
host
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
|
show 1 more comment
If you are listening on port 3333
and forwarding to private_ip:22
, you need to use your localhost
with the port you are listening on:
git clone ssh://user@localhost:3333/path/to/bare/repo.git repo
PS: Make sure your user has SSH access to the private_ip
host
If you are listening on port 3333
and forwarding to private_ip:22
, you need to use your localhost
with the port you are listening on:
git clone ssh://user@localhost:3333/path/to/bare/repo.git repo
PS: Make sure your user has SSH access to the private_ip
host
answered Jan 29 at 16:18
AlgeriassicAlgeriassic
55138
55138
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
|
show 1 more comment
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
I run the command and the reply is "user@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).". I'm sure user can access private_ip because I work on remote server daily. even filezilla can easily login through the tunnel
– Mindexperiment
Jan 29 at 16:35
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
@Mindexperiment Well “Permission denied” means the connection did indeed reach the SSH server—for which you did not supply the required credentials.
– Daniel B
Jan 29 at 16:43
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
ok , good news! But, I'm using the default ec2-user credentials, I don't think I have others credentials
– Mindexperiment
Jan 29 at 16:49
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
As a test, did you try to ssh directly to localhost port 3333?
– Algeriassic
Jan 30 at 4:35
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
I solve the problem by setting my public key as the authorized_keys on the private server.
– Mindexperiment
Jan 30 at 9:32
|
show 1 more comment
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1398511%2fclone-git-bare-repository-behind-private-vpn%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
Does your user have ssh access to your repo?
– Algeriassic
Jan 28 at 19:42
Hi, I can connect to the bastion (nat) on the public layer and from there I can ssh user@private_id and access the server. I can also connect through the tunnel with filezilla.
– Mindexperiment
Jan 29 at 13:21
using the same username?
– Algeriassic
Jan 29 at 14:41
yess, but when I open git bash and try to ssh to clone a bare repo I can't.
– Mindexperiment
Jan 29 at 14:44
I set up another tunnel, user@public_ip:22 L3333 private_ip:22 with (allow agent forwarding). I add my private key to pageant. I launch the tunnel session. I open git bash. I want to connect to the repo in private_ip and the command I have to write is ..?
– Mindexperiment
Jan 29 at 15:01