Gentoo Archives: gentoo-user

From: Steve Wilson <steve+gentoo_users@×××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Any way to automate login to host and su to root?
Date: Thu, 14 Jul 2022 21:23:05
Message-Id: ca2787b2-40e0-8f99-aa39-5afc0c7151b3@swsystem.co.uk
In Reply to: [gentoo-user] Any way to automate login to host and su to root? by "J. Roeleveld"
1 Have you looked at dev-tcltk/expect?
2
3 There's possibly an example you could try at
4 <https://www.journaldev.com/1405/expect-script-ssh-example-tutorial>
5 although you probably want to prompt for the password or retreive it
6 programatically rather than putting it on the command line :o
7
8 Steve.
9
10 On 14/07/2022 07:35, J. Roeleveld wrote:
11 > Hi All,
12 >
13 > I am looking for a way to login to a host and automatically change to root
14 > using a password provided by an external program.
15 >
16 > The root passwords are stored in a vault and I can get passwords out using a
17 > script after authenticating.
18 >
19 > Currently, I need to do a lot of the steps manually:
20 > ssh <user>@<host>
21 > su -
22 > (copy/paste password from vault)
23 >
24 > I would like to change this to:
25 > <some-script> <host>
26 >
27 > Does anyone have any hints on how to achieve this without adding a "NOPASSWD"
28 > entry into /etc/sudoers ?
29 >
30 > Thanks in advance,
31 >
32 > Joost
33 >
34 >
35 >

Replies

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