How to Automate Remote SSH Control of Computers with Expect Scripts

If you’re getting into automation, Bash scripting is usually the way to go. However, there are a couple of limitations, and one of them is logging into another device like a Raspberry Pi and running a script automatically. To help in those situations, we’re going to automate delivering an SSH payload with an “expect” script.

Bash scripting is more like duct-taping things together, so it isn’t able to do everything, including predicting and then reacting to certain variables. So we’re going to use an “expect” script to log in to our Raspberry Pi and automatically shut it down. We could also… more

Go to Source of this post
Author Of this post: Retia

By admin