From f507c8185720683e87bd87cfb9a68c529de27906 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Mon, 19 Jun 2017 07:12:00 +1200 Subject: [PATCH] sshpass: add page (#1411) --- pages/common/sshpass.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pages/common/sshpass.md diff --git a/pages/common/sshpass.md b/pages/common/sshpass.md new file mode 100644 index 000000000..d43e0f539 --- /dev/null +++ b/pages/common/sshpass.md @@ -0,0 +1,16 @@ +# 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}}"`