1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 01:42:09 +02:00
tldr/pages/common/sshpass.md
Lucas Gabriel Schneider a5fe31bc47
multiple pages: format technical tokens (#5119)
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2021-01-31 12:05:18 -05:00

16 lines
717 B
Markdown

# sshpass
> An ssh password provider.
> It works by creating a TTY, feeding the password into it, and then redirecting stdin to the ssh session.
- Connect to a remote server using a password supplied on a file descriptor (in this case, stdin):
`sshpass -d {{0}} ssh {{user}}@{{hostname}}`
- Connect to a remote server with the password supplied as an option, and automatically accept unknown ssh keys:
`sshpass -p {{password}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}}`
- 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}}"`