Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtCreator and Linux Device: SSH Connection Failure



  • Hi,

    I'm trying to solve a problem when attempting to test the connection between my Debian host and a Linux-based device.

    When clicking the test button, the following error is reported by QtCreator and I can't figure out how to resolve it:

    SSH connection failure: SSH Protocol error: Server sent unexpected SSH_MSG_USERAUTH_PK_OK packet.
    

    The connection between QtCreator and the target is set to use a password (the device login is just root with no password) and this used to work on older versions of QtCreator.

    Any suggestions please?

    I've attempted to use a Key for authentication but when I attempt to copy the key file across to the target via the terminal (using ssh-copy-id), I get a warning saying that keys already exist on the target but this does not seem to be the case.


  • Lifetime Qt Champion

    @webzoid said in QtCreator and Linux Device: SSH Connection Failure:

    I get a warning saying that keys already exist on the target

    You can try to remove it like shown here https://askubuntu.com/questions/317619/how-to-undo-an-ssh-copy-id



  • @jsulm Thanks for your quick reply.

    Where would the key live? I've looked in /home/user/.ssh/ but the directory doesn't exist.

    I've also tried clicking the "Deploy Public Key" button in the Devices window but the server rejected key message just appears.


  • Lifetime Qt Champion

    @webzoid It does not exist? Did you ever log-in via SSH as this user?



  • @jsulm Yes, I can log in via ssh into the system via the USB RNDIS adapter (and also ethernet but the former is more accessible in this device) and it works fine

    UPDATE
    If I wind QtCreator back to version 4.3.0 then everything works just fine - it would appear that this is a new feature in later versions?

    ANOTHER UPDATE
    If I attempt to ssh into the target using ssh -l root 192.168.11.1 then as soon as the connection is made, it is closed again with the following:

    ERROR: Connection to 192.168.11.1 closed by the remote host.
    

    Having done some more searching, there is mention of an ssh-agent however this does not exist on the target.

    @jsulm Is this required at all?


  • Lifetime Qt Champion

    @webzoid

    I had ssh connection problems with some version combinations of ssh client and server. especially root logins are default disabled in newer ssh servers and must be enabled first. password logins were disabled in some cases too.

    you will need to investigate deeper...


  • Lifetime Qt Champion

    Hi,

    There's a bug report related to that message.



  • @aha_1980 My investigations continue. There is some bizarre behaviour going on with the Angstrom target - a lot of ssh features or commands don't seem to be present - even though I can ssh into the thing. For example ssh-agent, ssh-add, etc are not present. I think when time allows, I'll push over to using Ubuntu on the target and forget about the current deployment.

    @SGaist Already spotted the bug report which was closed a while back. However, no work around had been suggested for it.


  • Lifetime Qt Champion

    @webzoid said in QtCreator and Linux Device: SSH Connection Failure:

    @SGaist Already spotted the bug report which was closed a while back. However, no work around had been suggested for it.

    As the bug is fixed, you don't need a workaround :)

    For example ssh-agent, ssh-add, etc are not present. I think when time allows, I'll push over to using Ubuntu on the target and forget about the current deployment. We use Angstrom on our Apalis iMX6 too, and deploying from Creator work - we just can't debug on target, but that's another story ;)

    Ok, but they are not needed everyday - maybe they are just missing to save flash space.

    even though I can ssh into the thing

    So connecting by command line works? Even with public key? I just don't work from Creator?



  • Open a terminal and test ssh connection from Debian(Host) to Target with --verbose as:

    ssh -vvv root@ip

    If you can, put the output here.


    Cleiton Bueno

    Blog | Linkedin | B2Open



  • @Cleiton-Bueno ,
    I tried to install Qt Creator trying to connect with my target Linux board as target device,
    I made static IP for target device and tried in terminal with this command a you suggested. I have attached snapshot of error it is showing. Please help me with this.
    Thanks
    Gokul.
    SSHconnectionFailure_2.JPG SSHConnectionFailure.JPG


  • Lifetime Qt Champion

    Hi @Gokulnath,

    • how is your target connected to your computer?
    • which IP address does your Linux machine have?
    • it seems your Linux runs inside VirtualBox, how is the virtual network configured (bridged, NAT, ...)?

    Regards


Log in to reply