Articles in this section

Unable to start migration in Plesk: Failed to connect to the source server 'source' (203.0.113.2) by SSH: encountered RSA key, expected OPENSSH key

kb: bug Plesk for Linux ext: migrator

Applicable to:

  • Plesk for Linux

Symptoms

  • Migration via SSH key fails with one of the following errors in Tools & Settings > Migration and Transfer Manager:

    PLESK_ERROR: Failed to connect to the source server 'source' (203.0.113.2) by SSH: encountered RSA key, expected OPENSSH key

    PLESK_ERROR: Failed to check SSH connection to the source server 'source' (203.0.113.2): q must be exactly 160, 224, or 256 bits long

    PLESK_ERROR: Failed to check SSH connection to the source server 'source' (203.0.113.2): p must be exactly 1024, 2048, or 3072 bits long

  • Paramiko version 2.9 or above is installed on the target server:

    Debian-based OS (Debian, Ubuntu, etc.):

    # dpkg --list | grep paramiko
    ii plesk-py27-paramiko 2.10.3-ubuntu.20.04.220330.1131 amd64 SSH2 protocol library

    RPM-based OS (CentOS, RHEL, CloudLinux, AlmaLinux, etc.):

    # rpm -qa | grep paramiko
    plesk-py27-paramiko-2.10.3-1centos.7.220330.1131.x86_64

  • OpenSSH version 5.9 or lower is installed on the source server:

    # ssh -V
    OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

Cause

Product issue:

  • #PMT-5041

Workaround

Regardless of which Linux distributive is in use, before applying the personalized steps below, add the SSH-RSA support to the SSH client's config file at /etc/ssh/ssh_config

  1. Connect to the target server via SSH;
  2. open the file

    # vi /etc/ssh/ssh_config

  3. Add the following line

    # PubkeyAcceptedKeyTypes +ssh-rsa

For Debian-based distributions (Debian, Ubuntu, etc)
  1. On Plesk's PMM repository, find the folder for your Linux Distribution and get the URL for Paramiko 2.7.

  2. Replace the URL from the command below and fetch the Paramiko package:

    # wget http://autoinstall.plesk.com/PMM_0.1.11/dist-deb-Debian-10.0-x86_64/packages/plesk-py27-paramiko_2.7.1-debian.10.200520.1813_amd64.deb

  3. Downgrade Paramiko with the following commands:

    # dpkg -r --force-depends plesk-py27-paramiko
    # dpkg -i plesk-py27-paramiko_2.7.1-debian.10.200520.1813_amd64.deb

For RPM-based distributions (CentOS, RHEL, Cloudlinux, etc.)
  1. Connect to the target server via SSH;

  2. On Plesk's PMM repository, find the folder for your Linux Distribution and get the URL for Paramiko 2.7.

  3. Remove the current paramiko package from the server:

    # rpm -e plesk-py27-paramiko --nodeps

  4. Replace the URL from the command below with the one from step 2 and install the Paramiko package:

    # rpm -i --nodeps http://autoinstall.plesk.com/PMM_0.1.11/dist-rpm-CentOS-7-x86_64/packages/plesk-py27-paramiko-2.7.1-1centos.7.200210.1834.x86_64.rpm

Was this article helpful?

Comments

1 comment
Date Votes
  • When running the last command, I got an error

    # dpkg -i plesk-py27-paramiko_2.7.1-debian.10.200520.1813_amd64.deb

    Selecting previously unselected package plesk-py27-paramiko.
    (Reading database ... 126816 files and directories currently installed.)
    Preparing to unpack plesk-py27-paramiko_2.7.1-debian.10.200520.1813_amd64.deb ...
    Unpacking plesk-py27-paramiko (2.7.1-debian.10.200520.1813) ...
    dpkg: dependency problems prevent configuration of plesk-py27-paramiko:
     plesk-py27-paramiko depends on plesk-py27-pycrypto; however:
      Package plesk-py27-pycrypto is not installed.

    dpkg: error processing package plesk-py27-paramiko (--install):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     plesk-py27-paramiko

    I needed to download the package plesk-py27-pycrypto also :

    # wget http://autoinstall.plesk.com/PMM_0.1.11/dist-deb-Debian-10.0-x86_64/packages/plesk-py27-pycrypto_2.6.1-debian.10.200520.1813_amd64.deb

    And then install both packages :

    # dpkg -i plesk-py27-paramiko_2.7.1-debian.10.200520.1813_amd64.deb plesk-py27-pycrypto_2.6.1-debian.10.200520.1813_amd64.deb

    0

Please sign in to leave a comment.