How Do I Set Environment Variables to Collect and Migrate Linux Servers That Use OpenSSH Earlier Than 7.0?
MgC supports collection and migration for Linux distributions and versions that use OpenSSH 7.0 or later. If a source server uses OpenSSH earlier than 7.0, you need to add environment variables to the server where the MgC Agent is installed to ensure compatibility.
Procedure
The procedure depends on the OS where the MgC Agent is installed.
- Stop the MgC-Agent.
- Open the Task Manager on the Windows server where the MgC Agent is installed.
- On the Services tab, find the MgC-Agent service.
- Right-click this service and choose Stop to stop the MgC Agent.
- Add system environment variables.
- Press Win+R to open the Run window.
- Enter sysdm.cpl and press Enter to open the System Properties window.
- Click the Advanced tab and click Environment Variables.
- In the System variables area, click New and add the variables listed in the table below. The default values of these variables are provided by MgC. You need to adjust the values according to the algorithms supported by the source system.
Table 1 Default variable values Variable Name
Variable Value (Default)
EDGE_JSCH_SERVER_HOST_KEY
-Djsch.server_host_key=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256
EDGE_JSCH_CLIENT_PUB_KEY
-Djsch.client_pubkey=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256
MGC_MAC_ALGORITHM
hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,umac-128@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96,aes256-gcm@openssh.com, aes128-gcm@openssh.com
- After adding all variables, click OK to save the environment variables.
- Restart the MgC Agent.
- Open the task manager of the server where the MgC Agent was installed.
- On the Details tab, right-click MgC-Agent and choose Start from the shortcut menu.
- After the MgC Agent is started, go to the login page.
- (Optional) If an error is still reported during subsequent collection and migration after the preceding steps are performed, continue to configure the environment variables of the Windows server as follows:
- In the MgC Agent log file C:\MgC-Agent\logs\agent-server\run.log, find the line that contains the following error information:
- algorithmName="server_host_key"
- algorithmName="PubkeyAcceptedAlgorithms"
- algorithmName="mac.c2s"
- View the algorithm list following serverProposal= and find the algorithms that are not in the Default variable values. Then, select a troubleshooting method based on the actual error information by referring to Table 2.
For example, the algorithm list following serverProposal= contains ed25519, but this algorithm is not in the "Default variable values" table.
Table 2 Error information and troubleshooting methods Error Message
Troubleshooting Method
- algorithmName="server_host_key"
- algorithmName="PubkeyAcceptedAlgorithms"
Add algorithms (for example, ed25519) that are not in the "Default variable values" table to the values of the EDGE_JSCH_SERVER_HOST_KEY and EDGE_JSCH_CLIENT_PUB_KEY variables added in step 2.
algorithmName="mac.c2s"
Add algorithms (for example, ed25519) that are not in the "Default variable values" table to the value of the MGC_MAC_ALGORITHM variable added in step 2.
- After updating the variable values, click OK to save the environment variables.
- Restart the MgC Agent by referring to step 3, and then continue the collection and migration.
- In the MgC Agent log file C:\MgC-Agent\logs\agent-server\run.log, find the line that contains the following error information:
- On the server where the MgC Agent is installed, run the following command to stop the MgC Agent:
sh /opt/cloud/MgC-Agent/scripts/stop.sh
- Run the following commands to add the three system environment variables below. The default values of these variables are provided by MgC. You need to adjust the values according to the algorithms supported by the source system.
echo "export EDGE_JSCH_SERVER_HOST_KEY=-Djsch.server_host_key=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256" >> /opt/cloud/MgC-Agent/scripts/setenv.sh
echo "export EDGE_JSCH_CLIENT_PUB_KEY=-Djsch.client_pubkey=ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256" >> /opt/cloud/MgC-Agent/scripts/setenv.sh
echo "export MGC_MAC_ALGORITHM=hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,umac-128@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96,aes256-gcm@openssh.com, aes128-gcm@openssh.com" >> /opt/cloud/MgC-Agent/scripts/setenv.sh
- Go to the scripts directory in the MgC Agent installation directory.
cd /opt/cloud/MgC-Agent/scripts/
- Run the following command to start the MgC Agent:
./start.sh
If the following information is displayed, the MgC Agent is started.
- Run the following command to view the MgC Agent process:
ps -ef |grep mgcagent
If the following information is displayed, the MgC Agent process is started.
- (Optional) If an error is still reported during subsequent collection and migration after the preceding steps are performed, continue to configure the environment variables of the Linux server as follows:
- In the MgC Agent log file /opt/cloud/MgC-Agent/logs/agent-server/run.log, find the line that contains the following error information:
- algorithmName="server_host_key"
- algorithmName="PubkeyAcceptedAlgorithms"
- algorithmName="mac.c2s"
- View the algorithm list following serverProposal= and find the algorithms that are not in the default variable values provided in step 2. Then, select a troubleshooting method based on the actual error information by referring to Table 3.
For example, the algorithm list following serverProposal= contains ed25519, but this algorithm is not in the "Default variable values" table.
Table 3 Error information and troubleshooting methods Error Message
Troubleshooting Method
- algorithmName="server_host_key"
- algorithmName="PubkeyAcceptedAlgorithms"
Add algorithms (for example, ed25519) that are not in the "Default variable values" table to the values of the EDGE_JSCH_SERVER_HOST_KEY and EDGE_JSCH_CLIENT_PUB_KEY variables added in step 2.
algorithmName="mac.c2s"
Add algorithms (for example, ed25519) that are not in the "Default variable values" table to the value of the MGC_MAC_ALGORITHM variable added in step 2.
- Restart the MgC Agent by referring to steps 3 to 5, and then continue the collection and migration.
- In the MgC Agent log file /opt/cloud/MgC-Agent/logs/agent-server/run.log, find the line that contains the following error information:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot