Running RSJ as SYM user and elevating to root
What is it?
By default, RSJ was defined in the Enterprise Manager to run as root, but it immediately changed to the SYM user after starting. This page describes how to configure RSJ to run entirely under the SYM user context, and how to use the ExecuteAsRoot directive to temporarily elevate permissions for specific jobs that require root access (such as SYSTEMBACKUP in Episys SP3 and later).
- Use this configuration to improve security by removing the root job definition from OpCon.
- Use
ExecuteAsRootonly for the specific Symitar programs that require root permissions.
Running RSJ as a SYM user
Configure the agent
To configure the agent to run under the SYM user, complete the following steps:
- In
$LSAM_ROOT/config/<socket>/lsam.conf, setpath_to_sutono. - Stop and restart the agent.
Configure the RSJ installation
This must be done while logged in as the root user. If the directories already exist, verify that the permissions are set correctly.
To configure the RSJ installation, complete the following steps:
- Create the required directories by entering:
mkdir /opsmkdir /ops/binmkdir /ops/bin/argsmkdir /ops/bin/cancelmkdir /tmp/SMA
- FTP or copy the RSJ tar file to
/ops/bin. - Extract the tar file by entering:
cd /ops/bintar xvf *.tar
- Set the correct directory permissions by entering:
chmod -R 777 /opschmod 775 /ops/bin/*chmod 777 /ops/bin/argschmod 777 /ops/bin/cancelchmod 777 /tmp/SMA
Temporarily raising permissions to root
Background
With Service Pack 3 of the latest version of Episys, Symitar modified the SYSTEMBACKUP script to include a command (cfgmgr) that can only be run by root or a user in the system group. This means that specific jobs must be run as root. RSJ provides the ExecuteAsRoot directive to allow a Symitar batch job to run as root and then return to the SYM user.
For example, in a GOODNIGHT job where only BACKUPSYM000TOSYM001 requires root:
%JOBFILE OFFLINE
%JOBFILE BACKUPSYM000TOSYM001
%JOBFILE CLOSEDAY
%JOBFILE SMA_DATES.JOB
%JOBFILE DELETE_REPORTS
%JOBFILE ONLINE
Add the ;ExecuteAsRoot directive immediately before the job that requires root:
%JOBFILE OFFLINE
;ExecuteAsRoot
%JOBFILE BACKUPSYM000TOSYM001
%JOBFILE CLOSEDAY
%JOBFILE SMA_DATES.JOB
%JOBFILE DELETE_REPORTS
%JOBFILE ONLINE
Create the root information file
To set up the root information file, complete the following steps:
-
Change directories to
/ops/binand examine the filerootInfo. The default values are:rootPromptCharacter=#pathToExpect=/usr/bin/expectpathTosu=/usr/bin/supathToEnvironment=/SYM/OP/bin/LOGONVerify that these values are correct. Run
su - rootto verify the root prompt character. The default prompt string is<hostname> #— only the ending#needs to be specified. There may or may not be an environment file at/SYM/OP/bin/LOGON. -
Once the values are correct, run
EncryptRootInfo. You are prompted for the root password.EncryptRootInfocreates an encrypted file calledrootInfo.encrypted. -
Complete the setup by running:
cp ExecuteAsRoot /SYM/<SYM#>/BATCH/ExecuteAsRootchgrp <SYM#> /SYM/<SYM#>/BATCH/ExecuteAsRootchown <SYM#> /SYM/<SYM#>/BATCH/ExecuteAsRootchmod 700 /SYM/<SYM#>/BATCH/ExecuteAsRootExampleFor SYM000:
cp ExecuteAsRoot /SYM/SYM000/BATCH/ExecuteAsRootchgrp SYM000 /SYM/SYM000/BATCH/ExecuteAsRootchown SYM000 /SYM/SYM000/BATCH/ExecuteAsRootchmod 700 /SYM/SYM000/BATCH/ExecuteAsRootNoteWith the SP3 release of Episys 16, the script
/SYM/MACROS/SYSTEMBACKUPwas rewritten to include thecfgmgrcommand. An environment variable (ODMDIR) is also required.
Include the environment variable
To add the required environment variable, complete the following steps:
-
Log in as root and run
env. Note the value forODMDIR. -
Create the file
/SYM/OP/bin/LOGON(if it does not exist). Add the following line:export ODMDIR=<value from step 1>If the directory
/SYM/OP/bindoes not exist, create it:mkdir /SYM/OP/binchmod 777 /SYM/OP/binThen create the file:
echo "export ODMDIR=/etc/objrepos" > /SYM/OP/bin/LOGON -
Edit
/ops/bin/rootInfoand setpathToEnvironmentto/SYM/OP/bin/LOGON. -
Change directories to
/ops/binand runEncryptRootInfo.
Limitations
- The
;SCRIPTdirective does not runExecuteAsRoot. This prevents malicious use. - If a job has been elevated to root permission, all
;SCRIPTspecifications within the job or sub-jobs run as the SYM user, not as root. - The
ExecuteAsRootapplication can only be driven by RSJ through the SMA Technologies agent. - The
ExecuteAsRootapplication cannot be renamed.