Skip to main content

Connect to private repository using ssh keys with non-standard SSH port

Comments

9 comments

  • ffeingol
    I may be mis-reading your post, but changing the SSH port on your server has no effect on the SSH port for bitbucket.org. You'd still use whatever their SSH port is. You just need to make sure that your outbound firewall rules allow the bitbucket.org SSH port.
    0
  • Spidey Catalin
    I may be mis-reading your post, but changing the SSH port on your server has no effect on the SSH port for bitbucket.org. You'd still use whatever their SSH port is. You just need to make sure that your outbound firewall rules allow the bitbucket.org SSH port.

    Well, everything was working fine before I changed the port. Maybe it's because I removed the 22 port for TCP OUT too .. ? But why the error says that it tries to connect to the new SSH port ? Because this port was only to reach my server and not any outgoing ssh connections.. like Bitbucket in this case..
    0
  • kodeslogic
    Yes, you will have to add 22 to TCP_OUT in the csf config file in order to SSH the remote server (port 22).
    0
  • Spidey Catalin
    Added port 22 back to TCP_OUT list and restarted CSF and ssh service, but looks like I have the same error, like it tries to connect to the new SSH port 56022. Don't know why.. should I specify somehow within the repository to connect to port 22? It's very strange
    0
  • George_Fusioned
    Is it possible that you also changed the Port setting in the /etc/ssh/ssh_config file? The SSH server's settings are in /etc/ssh/sshd_config If you added "Port 56022" under Host * in /etc/ssh/ssh_config (which is the SSH client's configuration) then indeed all your outgoing SSH connections will default to port 56022.
    0
  • andrew.n
    I agree with @wintech2003 it could be that you adjusted ssh_config as it wouldn't use port 56022 for outgoing connections otherwise.
    0
  • cPRex Jurassic Moderator
    Great collaboration here, everyone :D
    0
  • Spidey Catalin
    Yes, you are right @wintech2003 and @andrew.n .. I have edited sshd_config and ssh_config too .. :D didn't realize that they are 2 different files. Thanks for your implication. Happy new year! :)
    0
  • andrew.n
    Hahaha no worries, I'm glad it was so easy! Happy New Year!
    0

Please sign in to leave a comment.