Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

22
sshpass Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# sshpass
> An ssh password provider.
> It works by creating a TTY, feeding the password into it, and then redirecting `stdin` to the ssh session.
> More information: <https://manned.org/sshpass>.
- 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 {{path/to/file}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}} "{{command}}"`