pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

SSH backend prompts for password 3x

Open elfgoh opened this issue 7 years ago • 3 comments

When using ssh as a backend and using password for authentication, i get prompted for a password 3x. However when I ssh directly ssh [email protected], there is only 1 prompt.

Using sshpass doesnt work at all as well and I suspect that it is due to multiple password prompts.

Is this a known issue and is it possible to make the output more verbose for debugging, eg from ssh

elfgoh avatar Aug 06 '17 06:08 elfgoh

If you don't use ssh-agent, password will be promted for each command testinfra need to run over ssh (for instance using host.package() require some commands to be run to detect package manager).

philpep avatar Aug 12 '17 16:08 philpep

@elfgoh / @philpep could you explain how you have used ssh backend connection with password authentication. I am trying the same for my use case and not sure how to specify the password!

ruheenaansari34 avatar Mar 10 '20 16:03 ruheenaansari34

@ruheenaansari34: You can specify the password along with the user in the get_host URL: ssh://<user>:<password>@<host>. This requires sshpass to be installed, though.

8ware avatar Jan 03 '21 17:01 8ware