Page History
...
To allow user switching the Agent's run-time account has to be added to the /etc/sudo.conf
file.can use sudo
like this:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
sudo -su <user> <<EOF whoami pwd EOF |
...
<user>
is any user account available from the operating system for which a login is performed.- For execution of multiline commands a Here String is used:
- The commands between
<<EOF
(line 1) andEOF
(line 4) are executed usingsu
sudo
. - Instead of
EOF
any unique string can be used that does not match one of the commands to be executed. - Using
<<'EOF'
will prevent substitution of environment variables in a Here String.
- The commands between
- Executing
su
sudo
from the a non-root account does not require requires to specify thesudo
configuration. The location of thesudo
configuration file depends on the account's password.
...
- operating system, for example
/etc/sudo.conf
or/etc/sudoers
.- Example
To allow the Agent run-time account to run jobs on user accounts
user1
,user2
the following setting can be used in thesudo
configuration file.<run-time-account> ALL=(user1, user2) NOPASSWD: ALL
To allow the Agent run-time account to run jobs on all user accounts the following setting can be used:
<run-time-account> ALL=(ALL) NOPASSWD: ALL
- Example
Using Script Includes
Status | ||||
---|---|---|---|---|
|
Overview
Content Tools