Running the Agent as a Custom User
The installation script will create a service user called bakupagent
and this user is what runs the agent itself once it is installed, you are free to change its permissions, log what it executes and reads etc. The installation runs as root so that the agent can set itself up, read configuration files but demotes itself to the bakupagent
service user afterwards. The user ID that the agent uses is stored in
/etc/opt/bakupagent/USER_ID
, this is then read each time the agent is launched.
You can alter which user the agent uses, however, it is recommended that you stick to the default behavior of letting the agent use the service user which is created for it(bakupagent
). Under special conditions you can use another user if you need to.
#
Changing the User ID after installationTo change the user that the agent executes as, follow these steps:
Get the ID of the user that you would like the agent to execute as using:
id -u [USERNAME]
Overwrite the stored value in
USER_ID
using (without brackets around your user's ID):echo [USER_ID] | sudo tee /etc/opt/bakupagent/USER_ID
Restart the agent for the change to take effect:
sudo service bakupagent restart