I stood up CentOS 7 nix OS via Oracle VM VirtualBox from Windows 11 workstation. Then I installed latest gitlab via Docker. So far I was able to do followings:
- gitlab is running successfully
- I was able to access its web console from a browser
- I was able to create new user (non-root) as John
- I was able to create a new project as hello-world and create ssh key pairs for that user
- I have git bash running on Windows 11 and ran ssh-keygen to create key pairs
The problem I am having is when I tried to run git clone git@localhost:john/hello-world.git
I am getting ssh: connect to host localhost.com port 22: Connection timed out
fatal: Could not read from remote repository..
I read a few articles about it including this and tried its suggested solution although I didn't understand it: ssh: connect to host github.com port 22: Connection timed out
I'd appreciate if someone could explain to me why this is happening/how to resolve it. I am newbie in linux + networking + ssh.
Update:
This is not a solution to the question I posted but workaround temp solution for me.
Instead of using ssh key, I decided to use username/password which allowed me to download the repo in git bash. I did two things.
- I added VM's IP address and its hostbame on C:\Windows\system32\drivers\etc\hosts - This I should have done first, newbie's mistake.
- Afterward, I ran
git clone http://john@localhost/john/hello-world.git