2

I want to host gitlab on one of my servers, and it seems that gitlab needs to listen to port 22 for ssh (git ssh protocol). But the problem is my host machine already uses port 22 for sshd and I need it to be that way so I can remote into the machine. I am just wondering what is the best practice here? Do you change sshd to listen to another port? Or you change gitlab to use another port? It seems to me neither of the two options is very satisfactory, the first one means I need to remember which port I use when I ssh into the machine, the second one means I need to ask all users to remember to push to gitlab_url:port when they want to push to gitlab. What's your solution?

Boyu Fang
  • 121
  • 3
  • 5
    Gitlab uses your existing ssh server on port 22. When you add a key in gitlab, it configures the ~git/.ssh/authorized_keys file to allow that key and run a limited shell (gitlab-shell). –  Nov 06 '18 at 19:51
  • @yoonix actually mine is not working, no matter what i do it won't work along with the existing sshd – Pezhvak Dec 20 '19 at 19:32

1 Answers1

0

You can create a virtual network interface. This way you can assign both sshd and gitlab to listen on port 22 for each interface.

victoroloan
  • 196
  • 4