I have a hosting plan from the folks at HostGator.
They allow SSH connections on port 2222
.
I'm using "Git Bash" on Windows to connect to HostGator via SSH. Works fine with ssh -p 2222 <hostX>
. Next step, I try to set up a git remote repository in my public_html
folder like so:
mkdir test
cd test
git init
and no problems thus far. I can add it to my local repository via git remote add <repoLocalName> <hostX>:/public_html/test
. Next thing I try is to fetch
from the remote repository trough git fetch <repoLocalName>
- this comes back with an error: "ssh: connect to host port 22: Bad file number; fatal: Could not read from remote repository."
So I'm thinking to set up a config file. I create one here: ~/.ssh/config
and it has the following lines that are either not taken into account or give out errors:
Host <hostAddress>
Port 2222
PreferredAuthentications publickey,password
The host is not recognized, port not recognized either, and the PreferredAuthentications
parameter gives an error - so there's definitely something I'm not doing right with the whole config file aspect of the problem.
What I'm trying to accomplish with this whole procedure is a deployment on a live test server of a website I'm working on - so it's kind of a learning curve - but the above problems have stopped me in my tracks.