Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't connect to remote host using remote debugging settings
Can't connect to remote host using remote debugging settings [message #1847535] Sun, 31 October 2021 13:45 Go to next message
Artem Kostin is currently offline Artem KostinFriend
Messages: 3
Registered: October 2021
Junior Member
Hi,
I installed Eclipse IDE for C/C++ Developers (includes Incubating components)
Version: 2021-09 (4.21.0)
Build id: 20210910-1417
OS: Linux, v.5.4.0-89-generic, x86_64 / gtk 3.22.30
Java vendor: Oracle Corporation
Java runtime version: 16.0.2+7-67
Java version: 16.0.2.
I have small test C project for arm platform (remote arm board with Linux installed, OpenSSH_8.7p1, OpenSSL 1.1.1l 24 Aug 2021).
While trying to setup Run->Debug Configurations:
1. C/C++ Remote Application
2. Main, project name test1.
3. Connection->New->SSH host.
4. Host: arm-host (resolved, no network issues), user root, public key based authentication (or password based, no matter).
Then I press Browse button near Remote absolute file path.. and get com.jcraft.jsch.JSchException: session is down error.
On the target board I see:
channel_by_id: 0: bad id: channel free
Disconnecting user root dev-pc port 38580: data packet referred to nonexistent channel 0.
in the plugins:
Eclipse Orbit JSch 0.1.55.v20190404-1902 com.jcraft.jsch
Eclipse.org JSch Core 1.3.900.v20200422-1935 org.eclipse.jsch.core
Eclipse PTP JSch Remote Support 1.0.0.202109011318 org.eclipse.remote.jsch.core
Eclipse.org JSch UI 1.4.0.v20210426-0843 org.eclipse.jsch.ui
Eclipse PTP JSch UI Remote Support 1.0.0.202109011318 org.eclipse.remote.jsch.ui
look like latest versions.
Can I get help with resolving this connection issue?
Thanks!

Re: Can't connect to remote host using remote debugging settings [message #1847540 is a reply to message #1847535] Sun, 31 October 2021 18:08 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
On your host computer, what is the first line of ~/.ssh/id_rsa ?

You may be bitten by the new encoding format of OpenSSH. The SSH support libraries used by Eclipse do not understand the OpenSSH format, but the more common PEM format instead. OpenSSH understands both formats.

If the first line contains the text BEGIN OPENSSH PRIVATE KEY, the key is the culprit.

Make a back-up copy of the id_rsa file and do the following

ssh-keygen -p -m PEM -P "" -N "" -f ~/.ssh/id-rsa

This assumes that the key is not password-protected. If it is, put the old passphrase between the quotes after -P and the new one in the quotes after -N.
You need both even when they are identical.

Now the first line on the key file should contain BEGIN RSA PRIVATE KEY.


--

Tauno Voipio
Re: Can't connect to remote host using remote debugging settings [message #1847593 is a reply to message #1847540] Tue, 02 November 2021 07:07 Go to previous messageGo to next message
Artem Kostin is currently offline Artem KostinFriend
Messages: 3
Registered: October 2021
Junior Member
Hello Tauno,
thank you for your reply.
Unfortunately, I have BEGIN RSA PRIVATE KEY already.
Googling for "channel_by_id: 0: bad id: channel free" I found some issues dated 2017, but don't think, that is not fixed at the current time. And some issues with FreeSSH (that recommend switch to OpenSSH), but I have OpenSSH already.
Also I tried to downgrade Eclipse C++ bundle to 2021-6 with no results.
May I have your Eclipse version (or C++ bundle) and OpenSSH version on the your target host? I will to get the same.
Thank you!
Re: Can't connect to remote host using remote debugging settings [message #1847630 is a reply to message #1847593] Tue, 02 November 2021 14:45 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
I have to orient myself to your target system, so I have to start with questions.
- What is the the target system (some ARM with some Linux?)
- What is the SSH server on the target?
- What is the host operating system, version?

I am not sure how you're connecting. Eclipse assumes that the target has the SSH server and the host (with Eclipse) the client.

The setup I last used, was running with Kubuntu 20.04 LTS on the host and Raspbian Linux v. 10 (Buster on the Raspberry. The setup has been tested with several Kubuntu releases from 18.04 LTS to 21.10.

The OpenSSH client on Kubuntu is OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020.

The OpenSSH server on Raspberry is OpenSSH_7.9p1 Raspbian-10+deb10u2+rpt1, OpenSSL 1.1.1d 10 Sep 2019.

If I were you, I'd first try without Eclipse, just connecting to the target with SSH.
Next attempt would be using the Terminal view on Eclipse with SSH.


--

Tauno Voipio
Re: Can't connect to remote host using remote debugging settings [message #1847995 is a reply to message #1847630] Tue, 16 November 2021 20:16 Go to previous messageGo to next message
Artem Kostin is currently offline Artem KostinFriend
Messages: 3
Registered: October 2021
Junior Member
I trying to connect via Eclipse SSH terminal or Ubuntu system terminal ssh client and connection is succeeded. Only Debug Configuration settings (or actual debug session) isn't working.
I have Poky (Yocto Project Reference Distro) 3.4 cyclone5 distro + OpenSSH_8.7p1, OpenSSL 1.1.1l 24 Aug 2021.
Re: Can't connect to remote host using remote debugging settings [message #1848013 is a reply to message #1847995] Wed, 17 November 2021 12:49 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
It is not a good idea to run the target as root.

Can you do scp copies to/from the target?


--

Tauno Voipio
Previous Topic:Files Extension (*.cpp) not added automatically by Eclipse IDE when they are created.
Next Topic:Indexer stops too many errors
Goto Forum:
  


Current Time: Fri Mar 29 02:21:00 GMT 2024

Powered by FUDForum. Page generated in 0.04175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top