Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Any way to automate login to host and su to root?
Date: Fri, 15 Jul 2022 16:39:04
Message-Id: 0bee7f86-b5e4-dacd-4147-f7d305374a72@spamtrap.tnetconsulting.net
In Reply to: Re: [gentoo-user] Any way to automate login to host and su to root? by Steve Wilson
1 On 7/14/22 3:22 PM, Steve Wilson wrote:
2 > Have you looked at dev-tcltk/expect?
3
4 Expect has it's place.
5
6 Just be EXTREMELY careful when using it for anything security related.
7
8 Always check for what is expected before sending data. Don't assume
9 that something comes next and blindly send it (possibly after a pause).
10
11 Things break in a really weird and unexpected way. (No pun intended.)
12
13 Also, do as much logic outside of expect as possible. E.g. don't try to
14 add a user and then respond to a failure. Instead check to see if the
15 user exists /before/ trying to add it.
16
17 Plan on things failing and try to control the likely ways that it can fail.
18
19 Paying yourself forward with time and effort developing (expect) scripts
20 will mean that you reap the rewards for years to come.
21
22
23
24 --
25 Grant. . . .
26 unix || die

Replies

Subject Author
Re: [gentoo-user] Any way to automate login to host and su to root? "J. Roeleveld" <joost@××××××××.org>