Unable to SSH into Jetson Nano through Ethernet

I have an ethernet cable going from my laptop to my Jetson Nano and would like to ssh into the jetson. According to the following link:

https://devtalk.nvidia.com/default/topic/1043360/jetson-tx2/issue-reliably-ssh-ing-into-tx2/

I’m supposed to enter

ssh nvidia@<eth0 address>

However, when I enter the above (and substitute in my Jetson’s eth0 address obtained from ifconfig on the Jetson) from my laptop, I get the following error:

ssh: Could not resolve hostname <inet6 addr>%eth0: Name or service not known

If I enter the same ssh command but use the ethernet (enp4s0) address from my laptop, I get this:

ssh: connect to host <inet6 addr>%enp4s0 port 22: Connection refused

Also if I try to ping either address, I get an “unknown host” error.

Has anyone ever had a similar issue, and if so how did you fix it?

Thanks

hello agrtgrape,

  1. are you able to ping the target and get respond
  2. please have a try to execute below command on the server side to generate new host keys.
sudo ssh-keygen -A
  1. please re-flash the jetson-nano to see if the issue resolved.
3 Likes

Hello,

  1. I tried pinging the address. No response, and my error message is “ping: unknown host ”.
  2. I tried ssh-keygen and repeated all of the commands I tried at first (ssh, ping, etc. with all addresses). Still not working.
  3. I doubt that reflashing will fix things as this Jetson was just flashed and I haven’t done anything with it, so its state is pretty much the same as one that’s just been flashed.

Thanks

hello agrtgrape,

actually, we sometimes fix SSH connection refused issue after re-flashing the board.

It turns out that I had the wrong Ethernet connection set up on my laptop.

To fix the problem, I enabled Internet Connection Sharing over my laptop’s Ethernet connection. Under Ubuntu (on the laptop, not the Jetson) you would go to the IPv4 section of your connection properties and set the type to “Shared to other computers.”

Hello JerryChang, What do you mean by “re-flash the jetson-nano” ? How to do that ?

Thanks!

hello rvp85,

Once you install JetPack release with SDKMagager, it’ll also store the image to your local host, then you could perform script file to flash the board again.
you may also check the documentation, Flashing and Booting the Target Device for reference.
thanks

2 Likes

Hi,
Is there any other solution except re-flashing the Jetson Nano?
I encounter the same problem and in case I need to reflash it, it will through away weeks of works I’ve done on the device so far (plenty of complex installations).

I tried running:
sudo ssh-keygen -A

and it didn’t work

Any other suggestion?

Thanks,
Nir

Adding to my previous comment (failing to connect to Jetson with SSH due to timeout):
In order to fine tune where the problem comes from I used Wireshark on the client’s computer and ‘tcpdump’ on the Jetson.
The conclusion was that the client get to the server but the server doesn’t answer.
The following thread helped to understand that the problem probably comes from the firewall:
https://unix.stackexchange.com/questions/207141/ssh-server-not-answering-connection-requests

So I tried another thing that worked:

  1. Login to the Jetson
  2. Install ‘ufw’ and ‘sshserver’:
sudo apt-get install ufw openssh-server
  1. Add ‘ssh-server’ to the allow list:
sudo ufw allow openssh
  1. Disable the firewall by running:
sudo ufw disable
sudo ufw enable
  1. Restart Jetson
  2. Make sure that ufw is up with the updated configuration
sudo ufw status

Hope it helps

2 Likes

Nice! Thanks for sharing.

Hi,

I guess, I have more or less the same issue regarding accessing to Jetson Nano using SSH via Ethernet connection. Since this topic is quite relevant, I didn’t want to create a new one.

I can ping the nano from my Windows 10 PC but no SSH.
This is the image file name I downloaded recently;

nv-jetson-nano-sd-card-image-r32.2.3 (Release on 19112019)

I have properly flashed the image in a SD Card (128 GB)
I have setup the OS with initial setup by connecting a monitor.

And then:
I use that command line;

ssh sener@192.168.65.73

and

I get this;

ssh: connect to host 192.168.65.73 port 22: Connection refused

I have tried many things including the suggestions and experiences in this topic with no avail.

Note that: There is another thing I noticed with my nano. When I am using “Chrome web browser”, most of the time it stuck and and nothing return from web. This issue can be an indication of a faulty hardware or something relevant?!?!

What do you think?

If you log in to the Nano with the account “sener” (what I see from your login attempt above), do you have this file:

~/.ssh/known_hosts

This is a human readable file, and the left side contains a name and address combination. If the file is there, do you see lines matching the Windows system?

Also, if you log in locally to the system, you should be able to ssh to your own account. Logged in as “sener”, can you “ssh sener@127.0.0.1”?

The file was not there. But, normally, if I am not mistaken, it should have been automatically created when it’s been used for the first time.
Anyway, I played around and now we have the “known_hosts” file. But, the problem persists.

I have maybe 10 times re-flashed the image and started over.

Those same strange issues every time;

  • No SSH
  • The “nano ~/.bashrc” returned “bash: nano: command not found”. (during some Computer Vision related installations)
  • Unstable internet connection, one minute works and another minute unresponsive although it shows connected.

Perhaps it is the time to suspect from the image and/or hardware!?!?!

I like also Nvidia guys give their opinions?

Thank you.
log.txt (11.8 KB)

You are correct. This indicates nobody has successfully run ssh to that account. Also, if permissions in that directory are incorrect, then ssh will be refused. Are other files present? If so, what is the output from “ls -l ~/.ssh/*”?

If you do not have “nano”, then command would not be found. Try “sudo apt-get install nano”.

From login to the local host as that account (I will assume you are logged in locally to “sener”), can you do this:

ssh sener@localhost

If this fails, then what do you see from the verbose version? I’ll add some logging:

ssh -vvv sener@localhost 2>&1 | tee log.txt

If you hover your mouse over the quote icon in the upper right of one of your existing posts, then a paper clip icon will show up. You can use this to attach “log.txt”.

nano is not installed by default, but you can install it with “sudo apt install nano”

Is your connection wired? Have you tried another cable? If your connection is wireless and usb, have you tried the adapter in another usb port?

The above suggestion to “ssh sener@localhost” is also a good one on Nano, just to check if ssh is working.

Hi,

@mdegans,

you were right about “sudo apt install nano”. Once I run that “nano ~/.bashrc” , it took me to the edit screen this time. A progress!

And I have only Ethernet connection. I have already tried two different places where a working PC connected to it. But, it was still unstable connection.

I am wondering, since I didn’t know if I have to install nano as you suggested what if there will be maybe more to install.
On the other hand, what is the benefit of having ready to use image file from Nvidia if there are even some elementary setup missing in the OS ?!

@linuxdev,

I attached the log file to my previous post as you asked.

I appreciate your inputs, they made me feel there is still hope to get things done :)

I am an enthusiast software developer and planing to work with Computer Vision using Jetson nano. However, I couldn’t even pass OS issues. I can’t wait to see the light at the end of the tunnel.

I want to verify one detail first: This log was from the Jetson using ssh to itself (which is what I’m going by).

I see this part of the log showing success by password:

debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to localhost ([127.0.0.1]:22).

So we know that when no outside network is involved that your Nano correctly accepts logins by password. The Nano itself is working.

I am unsure how to debug ssh from Windows, but if you use an application such as PuTTY, are you able to get a verbose log of some sort? Or can you check if ssh from another PC running Linux is possible? If you can try login from another Linux PC, and if that login fails, then the same verbose ssh log from that PC remote connecting to the Nano would help.

One detail which may or may not be related is that I noticed some IPv6 addressing in there. It is possible there may be configuration issues related IPv6 support. IPv4 is always supported, but there may be cases when IPv6 may need additional configuration. If you are able to ssh from a Linux PC, then be sure to include the “ifconfig” from that PC to see if it uses IPv4 or IPv6.

The windows subsystem for linux works is probably easiest. Same commands. Openssh can also be installed or you can use a virtual machine.

Fwiw ssh works out of the box, which isn’t even the case for vanilla ubuntu because it’s disabled by default. For better or worse, on Nano, by default, sshd accepts password authentication on all interfaces at port 22 with no restrictions I’m aware of.

I’m unsure of why it’s not working for you, but I don’t believe the software to be the issue here. The problem is likely configuration or your network (or possibly hardware). If you’ve ruled out configuration by flashing a new image, it should work. I can confirm ssh works with the latest image for me.

Can you run these three commands on your nano and post the output?

ip address
cat /etc/ssh/sshd_config 
ssh sener@localhost

(assuming “sener” is your username on the nano)

I have a problem with the insulation of my jetson nano, wan I open the commend it asks me localhost name and password what should I writhe ??

When you first boot after installing the Nano’s software you have to set up a user name and password. There is no default. You’d use whatever you created on that first boot setup. If you did not set that up, then there won’t be anyone you can log in as.

1 Like