Nsight Eclipse: Failed to connect sshd to TX1 board

Hi all,

I am trying to use Nsight for remote application development ([url]https://devblogs.nvidia.com/parallelforall/remote-application-development-nvidia-nsight-eclipse-edition/[/url]). I have the following setup:

  • Host: Ubuntu 14.04 64-bit (architecture: x86_64)
  • Target: Jetson TX1 board with 64-bit Ubuntu 16.04 (architecture: aarch64)
  • The host (IP: 192.168.1.9) and the target (IP: 192.168.1.14) are connected to the same wireless network

I’m following the instructions in the blog post above, but get stuck while adding a remote connection on the host. I go to my project properties and under Build → Target Systems, select ‘Manage’. I add details for my Target system as shown below:

[url]https://drive.google.com/file/d/0Bzt5qP5DPRxDNkpvT2lLS3RicHc/view?usp=sharing[/url]

Then when I click on ‘Browse’ for the Target project path, I get the following error:

[url]https://drive.google.com/file/d/0Bzt5qP5DPRxDblBTUC1oRkI3QVE/view?usp=sharing[/url]

I am able to ssh to the Target through a terminal as follows:

[url]https://drive.google.com/file/d/0Bzt5qP5DPRxDZDh5c0hxNDR5Tmc/view?usp=sharing[/url]

I’ve looked at similar problems online and tried their suggestions, but haven’t been able to resolve it.
[url]https://devtalk.nvidia.com/default/topic/839207/eclipse-nsigh-on-mac-cannot-connect-via-ssh-tunnel-solved-/[/url]
[url]https://devtalk.nvidia.com/default/topic/792228/cuda-setup-and-installation/nvvp-connect-to-remote-server-through-an-ssh-proxy/[/url]
[url]Executing CUDA C++ Application on a remote machine using Nsight Eclipse | by Rajesh Kumar | Medium

Any help would be appreciated, thank you.

P.S.:
This is a duplicate post from [url]https://devtalk.nvidia.com/default/topic/990117/nsight-eclipse-failed-to-connect-sshd-on-lt-remote-ip-gt-/#5067740[/url]. I’m new to nvidia forums, and couldn’t find a way to post the topic under 2 subforums.

I can’t give you an exact answer, but it sounds like ssh works well via terminal…which probably uses a password. In that case eclipse will also need to be able to send a password. Perhaps there is other password setup in eclipse? If not, consider setting up ssh keys so your host can ssh into the Jetson without a password.

If you want to use ssh with a password, then typically there is some “askpass” program required for GUIs and other scripts to pop up a password entry widget. Under “man ssh”, see “SSH_ASKPASS”.

If you want to try ssh keys realize that you can still use a password so long as you don’t configure sshd to not allow passwords. Keys can make developer life much easier, so even if this does not solve your problem I’d still recommend it.

Before explaining generating keys, here is information on how to set up keys…

Each “~/.ssh/” directory can contain your own key in the form of a private key which may not have permissions for the world to read…it must be private and incorrect permissions will likely cause ssh to complain and not use the private key.

The same directory has a public key matching the private key…this key has a “.pub” file extension, and it must be world readable (this is used for encryption, and does not help decryption). You will need a public and private key pair on your desktop host.

That same directory on your Jetson will not have “~/.ssh/authorized_keys” until you copy your public key into that file. If the file is empty or missing, then nobody can ssh to that account via key. You’ll be adding a single very long line to authorized_keys for each remote host you want to be able to ssh in via key.

So step 1 is to generate a key pair on the host. I like 2048-bit RSA which tends to be recommended in many documents. Files will be named “id_rsa” (permissions “-rw-------”) and “id_rsa.pub” (permissions “-rw-r–r–”).

Step 2 is to copy id_rsa.pub over to the Jetson, and then to put it in the authorized_hosts file:

cat id_rsa.pub >> ~/.ssh/authorized_keys

Once this is done your host account should be able to ssh to the Jetson without a password (depending on circumstances you may need to log in from the host once via password).

To generate a key on your host:

ssh-keygen -t rsa -b 2048 -C "comment, name@machine"

…do note that if you use a password on the private key you may need to enter a password at times on your local machine…despite recommendations of using a pass phrase on that file you can do without the pass phrase if you don’t expect other people to be able to read the private key.

The “comment” is unnecessary, but you’ll be able to see this in your authorized_hosts file and once you have many keys the comment will make life easier (you can remove a key by deleting the single line it occupies in “authorized_keys”, but you need to know which key it is when removing it).

See if you can get eclipse to work without a password, and if that is not working, investigate SSH_ASKPASS setup (I can’t guarantee this is why eclipse fails, but it is high on the list of possibilities).

One consideration is that if you have keys involved on something you might flash or upgrade you should back up all involved “~/.ssh/” directories (client files) and “/etc/ssh/” files (host files). Placing a backed up “~/.ssh/” onto a sample rootfs, and a backed up “/etc/ssh/” onto a sample rootfs implies configurations will “just work” after flash…you won’t have to remove old keys or new auto-generated keys.

Hi linuxdev,

Thanks for your suggestions. I tried checking the ssh keys, but the problem persists.

When I checked my host “~/.ssh/”, id_rsa and id_rsa.pub already existed. I could also see the the id_rsa.pub line in my target authorized_keys. I backed those up, created a new key and copied the id_rsa.pub to authorized_keys using the commands you suggested.

Just to make sure, I also generated a key through Eclipse ([url]https://drive.google.com/file/d/0Bzt5qP5DPRxDRHFqcm4wTGFyTkU/view?usp=sharing[/url]) and copied it as a new line to my target authorized_keys, but that didn’t help.

I also tried to remove password authentication through Eclipse ([url]https://drive.google.com/file/d/0Bzt5qP5DPRxDTGRLbjlocUtZLWs/view?usp=sharing[/url]), but still got the same error.

I will investigate into SSH_ASKPASS next. Thank you!

I have the same problem. Were you able to resolve the issue @akshayshetty?

I haven’t followed up on an ssh version issue under Nsight, but this may be of interest:
[url]https://devtalk.nvidia.com/default/topic/988099/nsight-eclipse-edition/is-ssh-private-key-remote-access-broken-in-cuda-8-0-nsight-/[/url]

I don’t know if the ssh support was ever updated or not.