Help Center/ Migration Center/ MgC Agent Usage Guide/ FAQs/ How Do I Set Environment Variables to Collect and Migrate Linux Servers That Use OpenSSH Earlier Than 7.0?
Updated on 2025-09-23 GMT+08:00

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. but 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.

  1. Stop the MgC-Agent.

    1. Open the Task Manager on the Windows server where the MgC Agent is installed.
    2. On the Services tab page, find the MgC-Agent service.
    3. Right-click the service and choose Stop to stop the MgC Agent.

  2. Add system environment variables.

    1. Press Win+R to display the Run window.
    2. Enter sysdm.cpl and press Enter to open the System Properties window.
    3. Click the Advanced tab and click Environment Variables.
    4. In the System variables area, click New and add the variables listed in the table below. The example values of these variables are common algorithms. You need to adjust the values according to the algorithm list supported by the source system.

      Variable Name

      Example Value

      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

    5. After adding all variables, click OK to save the environment variables.

  3. Restart the MgC Agent.

    1. Open the task manager of the server where the MgC Agent was installed.
    2. On the Details tab, right-click MgC-Agent and choose Start from the shortcut menu.
    3. After the MgC Agent is started, go to the login page.

  1. 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

  2. Run the following commands to add the three system environment variables below. The example values of these variables are common algorithms. You need to adjust the values according to the algorithm list 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

  3. Go to the scripts directory in the MgC Agent installation directory.

    cd /opt/cloud/MgC-Agent/scripts/

  4. Run the following command to start the MgC Agent:

    ./start.sh

    If the following information is displayed, the MgC Agent is started.

  5. 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.