jwgibson949:
>/opt/BESClient/bin/ciplinux.csv ; for user in $(cut -f’1’ -d’:’ /etc/passwd); do echo “hostname
,sudo passwd -S $user
”; done | sed ‘s/ /,/g’ | cut -f1-4 -d’,’ | sed ‘s/LK/DISABLED/’ | sed ‘s/PS/ENABLED/’ >> /opt/BESClient/bin/ciplinux.csv
The agent is running with enough privilege so you don’t need to use sudo.
Also be aware that the agent’s environment is not the same as when you login with a shell.
Check to see if this is an issue.
related posts
If you’re executing scripts on Linux keep an eye out for the environment.
Your environment, when running via the agent, is likely to be different to that you get when you log in interactivley.
Have a look at this tip BES Client’s environment on *NIX
(imported topic written by gearoid)
It’s useful to know how the environment is set up when you’re using fixlets and tasks that execute shell scripts or shell commands.
In particular, the environment is probably not going to be the same as when you log in as a user, such as root.
The BESClient process envrionment is inherited by the process that’s running your shell command/script. This is a pretty small set of environment variables.
I use the following action script in a task to get the env…