0

Here's the situation: I frequently build new AWS hosts using terraform. After the initial build, there are several interactive steps that need to be performed on the hosts involving sudo. Would it be possible (assuming the password is provided by the user) to create a Perl (with expect) or Python3 (pexpect) script to interact with the SSH session to automate these steps?

An example task to automate (this is ONLY an example; I'm looking for a general solution, not one specifically for yum) would be:

$ ssh <new host>
Password: 
$ sudo yum -y update
[sudo] password for <my username>:

1 Answer 1

-1

It looks as if Net::SSH::Expect (SSH wrapper to execute remote commands) will do what I need. You can do SSH authentication with a user password or without it.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .