SSH Login with Password in URL

git, jenkins, passwords, ssh, storage

Solution

There are two reason why SSH ask you for a password:

- the public key isn't found on the server, meaning ssh defaults to the account used for the ssh session, asking for its password

- the public key is found, but the private key is password-protected.

The first case means ssh isn't working properly: you should never have to enter the password of the account you are using for ssh. The idea is to be able to authenticate someone even though all ssh connections will use one unique account. Entering the password of that unique account defeat the purpose.

The second case should be easy to solve, by running `ssh-agent` and `ssh-add`. That would allow you to not enter the password (more than once, when adding the key to the agent).

Problem

I have Jenkins cloning the Git repository at ssh://user@ip/repo/ and it all works fine, but I need to login with a password, which Jenkins doesn't support. Is there a way to login with the password in the URL? Security is not an issue for me. It should end up being, and I thought it was this at first: ssh://user:pass@ip/repo/ but it doesn't work. Thanks! Update #1: The git repo is on the same server.

Original source