The mjrmtjob command uses SSH communication. Perform the following before using the mjrmtjob command as a job:
Prepare an account for performing remote connection (login).
Prepare an account for the user who will execute the mjrmtjob command. (This user is hereinafter referred to as USERA.)
Prepare an account for <user name> to be specified in the mjrmtjob command. (This user is hereinafter referred to as USERB.)
Configure firewall settings.
Set the port that will use SSH through the firewall.
Port used for SSH:
Default (not specified by the mjrmtjob command -P option): 22/TCP
Specified by the mjrmtjob command -P option: Specified Port
Start the SSH service.
Start the SSH service. If SSH has not been installed, install it. Refer to "Related Software" in the Systemwalker Operation Manager Technical Guide for information on the required SSH version.
Refer to the relevant SSH manuals for information on how to install and start the service.
Configure login without a password.
You must configure these settings both on the Systemwalker Operation Manager server (SSH client) that will execute the mjrmtjob command and on the remote machine (SSH server).
If there are multiple accounts, configure them all in the same way.
The following steps use /home/USERA and /home/USERB as the home directories of the accounts that you prepared in step 1.
Execute the following to generate a public key:
$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/USERA/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/USERA/.ssh/id_rsa. : :
The following two files will be created in /home/USERA/.ssh/:
- id_rsa (private key)
- id_rsa.pub (public key)
Set permissions for the /home/USERA/.ssh/ directory and the id_rsa file (private key) located in it.
$ chmod 700 /home/USERA/.ssh $ chmod 600 /home/USERA/.ssh/id_rsa
Copy the id_rsa.pub file (public key) that was generated in step a to the remote machine (SSH server). The example below copies the file to /tmp on the remote machine. You can delete the id_rsa.pub file (public key) after you have deleted it.
$ scp /home/USERA/.ssh/id_rsa.pub USERB@<remote machine>:/tmp
Create public key.
The user (who execute mjrmtjob command) who create public key is as "USERA", execute as below if it is created under the d:\temp.
$ mjkeygen create -k d:\temp
The following file is created under the d:\temp.
USERA.mjeskey.pub(Public Key)
Note
The user who create public key (who execute mjrmtjob command)
In the job execution control, if the Execute jobs under the respective job owner's authority has not been specified, the user who execute mjrmtjob command is startup account of the "Systemwalker MpMjesuser" service.
If you need to change startup account, refer to the "D.1.1 Changing the Startup Account".
Transfer the USERA.mjeskey.pub (public key) created in a. to a remote machine (SSH server side), by ftp and so on.
You can delete USERA.mjeskey.pub (the public key) after the transfer.
In the following description, you transferred to/tmp on the remote machine.
In Windows, perform the tasks below on the Cygwin Terminal started (installed) in step 3. The actual home directory exists under the cygwin installation folder.
If the .ssh directory does not exist in the /home/USERB home directory of the account, create it and set permissions.
$ mkdir /home/USERB/.ssh $ chmod 700 /home/USERB/.ssh
Add id_rsa.pub (public key) that you copied in step c of "1) Configuring the Systemwalker Operation Manager server (SSH client) that will execute the mjrmtjob command" to the /home/USERB/.ssh/authorized_keys file. Set permissions when you first create the authorized_keys file. Then delete the /tmp/id_rsa.pub file.
$ cat /tmp/id_rsa.pub >> /home/USERB/.ssh/authorized_keys $ chmod 600 /home/USERB/.ssh/authorized_keys $ rm /tmp/id_rsa.pub
Check if you can connect (log in) from the Systemwalker Operation Manager server (SSH client) that will execute the mjrmtjob command to the remote machine (SSH server) without entering a password.
On the Systemwalker Operation Manager server (SSH client) that will execute the mjrmtjob command, execute the following as the user who will execute the mjrmtjob command:
$ ssh USERB@<remote machine>
Configuration is complete if you are not prompted for your password after you execute the above command.
If you are prompted for your password, there is an invalid setting. Review the settings.
Confirm that the mjrmtjob command can be executed. Note that if step 5 is required, confirm it after configuring the settings in step 5.
Set the environment variables.
On the remote machine, set the environment variables that are required for executing commands or shell scripts. Refer to the relevant SSH manuals for details.
For the above combination, JRE8 or later is required for the Systemwalker Operation Manager server (Windows) that executes the mjrmtjob command. Install JRE8 or later and set the installation path to the environment variable "MJRMTJOB_JAVA_HOME".
Configure the following settings for the Systemwalker Operation Manager server (Windows) that executes the mjrmtjob command in System Properties >> Environment Variables >> System variables.
Variable: MJRMTJOB_JAVA_HOME
Value: Installation path for JRE