2017-06-18 20:12:00 +01:00
|
|
|
# sshpass
|
|
|
|
|
|
|
|
> An ssh password provider.
|
2021-01-31 17:05:18 +00:00
|
|
|
> It works by creating a TTY, feeding the password into it, and then redirecting stdin to the ssh session.
|
2017-06-18 20:12:00 +01:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Connect to a remote server using a password supplied on a file descriptor (in this case, stdin):
|
2017-06-18 20:12:00 +01:00
|
|
|
|
|
|
|
`sshpass -d {{0}} ssh {{user}}@{{hostname}}`
|
|
|
|
|
|
|
|
- Connect to a remote server with the password supplied as an option, and automatically accept unknown ssh keys:
|
|
|
|
|
2017-06-18 23:27:11 +01:00
|
|
|
`sshpass -p {{password}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}}`
|
2017-06-18 20:12:00 +01:00
|
|
|
|
|
|
|
- Connect to a remote server using the first line of a file as the password, automatically accept unknown ssh keys, and launch a command:
|
|
|
|
|
|
|
|
`sshpass -f {{file}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}} "{{command}}"`
|