I have ssh keys setup to work on a specified port (e.g. 12345) and issued the following git command to set the origin on a local repo.
git remote add origin [email protected]:12345/path/to/public_html/files/
I am getting the following error message when i try to push to origin.
ssh: connect to host mydomain.com port 22: Connection refused
fatal: The remote end hung up unexpectedly
How do i set origin so it is using the proper port for ssh?
To specify a custom port, you have to add the ssh:// prefix. Otherwise, git interprets your 12345 as part of the project's path. See URLs in the git-pull docs. So:
git remote add origin ssh://[email protected]:12345/path/to/public_html/files/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With