i have a Webserver listening to SSH on Port 1234 .
The Webserver uses a public key in ~/.ssh/authorized-keys For authorisation.
To connect via SSH i have an private SSH Key with passphrase On my local machine
now i want this Server to be a git Remote Server, so on the Server i create a bare repo in my home directory with a nonRootUser.
mkdir ~/project.git
cd ~/project.git
git init --bare
Now on my local machinei create a new repo
mkdir myProject
cd myProject
git init
git add .
git commit -m "Initial commit"
FROM A SCRIPT i want to set the remote to the Webserver and push to it. And here is where i Stuck
git remote add origin ssh://nonRootUser@WebserverDomain.com:1234/home/project.git
git push origin master
this Produces the Error
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I think i still need to add the passphrase, but dont know how. And the Error still lets open if i'm close to an solution or not because it says make sure the repo exists. Thanks in advance