Git one-way username authentication clone

My current team

git clone ssh:// username@onboard.com /srv/git/repo 

after that

 password 

... excellent, works well.

Now I would like to do this on one line. Something like that:

 git clone ssh://username: password@onboard.com /srv/git/repo 

but it does not work and gives me a message:

 Please make sure you have the correct access rights and the repository exists. 

How can I clone in one line?

+7
git bash ssh
source share
1 answer

Instead, you should use the http URL to clone:

 git clone http://username: password@onboard.com /srv/git/repo.git 

Edit

If in case you can make it normal ssh only with user credentials, try using sshpass as:

 sshpass -p password git clone ssh:// username@onboard.com /srv/git/repo 

You may need to install sshpass for this.

Please note that this is the case when ssh keys are not configured correctly; if the ssh keys were configured, your public key will be shared with the target server, and you would not need to enter a password (perhaps you would have to enter a passphrase).

+18
source share

All Articles