Ssh into Jetson Nano from remote without login locally

My Jetson Nano 2G is booted and wait for my login, as:
login

Without login from Jetson Nano at the above page, I cannot ssh into Jetson Nano from remote, as follows:

➜  ~ ssh jetbot@192.168.1.XXX                                     
ssh: connect to host 192.168.1.XXX port 22: No route to host

I’ve got to login Jetson Nano from login dialog, before I can ssh into Jetson Nano remotely.
I’ve already tried all methods mentioned https://askubuntu.com/questions/3913/start-ssh-server-on-boot and https://serverfault.com/questions/1013285/ssh-server-wont-start-before-gui-login-om-kubuntu-18-04, none is working.

Can anybody help please?

Cheers

No route implies no suitable network setup, which is different than having a route, but failing. On the host side, what is the output from “ifconfig” and “route”? Are both connected to the same router? If you log in locally to the Jetson (assuming you can), what do you see on it with “ifconfig” and “route”?

ip commands clearly tell both my host desktop and the remote Jetson Nano are both 192.168.1.XXX, they clearly share the same router.

And I even checked ALL allocated IP addresses from within my router, the IP address of this particular jetson Nano was NOT typed wrong.

What’s more, everything on https://itsfoss.com/set-up-ssh-ubuntu/ is working properly, after I logged into Jetson Nano’s Login Dialog . But, I should be able to ssh into Jetson Nano remotely without login Jetson Nano’s login dialog locally.

I think this is probably because ssh service is NOT started before login the login dialog in Ubuntu 18.04.

Hi @jiapei1

Is your host able to ping jetson nano’s IP address under such situation?

If you are on the same subnet, which means not only a similar IP address, but also a compatible netmask, then no default route is needed. However, “no route” implies this is not valid. It should be, given what you said about address, but we really need to know ifconfig and route from both systems to be sure.

No route implies that no network connection was attempted. If it were an ssh issue, then there would be a route, but connection would be denied. A firewall would not cause connection denied, but it might interfere wiht route and cause a timeout…still different than “no route”. If on both systems we could see “route” and “ifconfig” (the two work in combination), then we could know more about the lack of route.

Incidentally, if on the Jetson you can “ssh 127.0.0.1”, then you can show ssh is running since it is always able to route to its own loopback. Furthermore, if on the Jetson you can “ssh 192.168.1.xxx” (where this is the exact IP address of the Jetson), then you can see if ssh works to that address without a need for external route. Most likely ssh is there, and the error (if any) won’t lack of route. This is not likely an ssh issue (there could be an ssh issue, but the route would have to work first before that issue could be found).

Nope… without login Jetson Nano’s login dialog, I cannot ping that IP address.
So, that seems to tell: before login Jetson Nano’s login dialog, Jetson Nano does NOT have a proper IP address yet.

➜  ping 192.168.1.XXX
PING 192.168.1.XXX (192.168.1.XXX) 56(84) bytes of data.
From 192.168.1.YYY icmp_seq=9 Destination Host Unreachable
From 192.168.1.YYY icmp_seq=10 Destination Host Unreachable
From 192.168.1.YYY icmp_seq=11 Destination Host Unreachable
^C
--- 192.168.1.XXX ping statistics ---
13 packets transmitted, 0 received, +3 errors, 100% packet loss, time 12279ms
pipe 4

Any replacement of route or ifconfig ? Look https://www.redhat.com/sysadmin/ifconfig-vs-ip#:~:text=ifconfig%20has%20been%20officially%20deprecated,move%20on%20with%20the%20world.&text=Since%20there%20is%20no%20%22without,IP%20addresses%20associated%20with%20interfaces., ifconfig is already deprecated…

  1. I tried. From local Jetson Nano, I can ssh 127.0.0.1

Is it because:
I’m using a USB dongle for Wifi connection? And, without login Jetson Nano’s login dialog, I’m NOT connected to the Internet yet? Does it have anything to do with USB driver initializzation? After I login Jetson Nano’s Login Dialog, I can clearly see the Wifi is connected (looks like Wifi is connected after login the local Login Dialog). Afterwards, without doing anything, I can ssh into Jetson Nano remotely…

1 Like

This can be easily solved by setting up automatic login.

Set to automatic login during os initialization.

Set to automatic login after login.

Example: Jetson Nano 2GB, username: jetbot

cat /etc/gdm3/custom.conf 
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=jetbot

# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false

# Enabling automatic login

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
1 Like

You can likely use “sudo apt-get install net-tools” (this is the package which provides “ifconfig”). You shouldn’t need the newer tools until Ubuntu 20.04. The replacement to ifconfig (which is used in Ubuntu 18.04, and sadly, I like this output format better than the replacement) is:
ip -s addr show

(you shouldn’t need to switch to “ip” since Nano does not work with Ubuntu 20.04; however, if you did, and if you did not also have the “ip” command, then you could install with “sudo apt-get install iproute2”)

Can you switch to either serial console, or else to a pure text-mode login? The keybinding can vary, but usually on any system this will get one of the (several) text-mode consoles:
CTRL-ALT-F3
(then to switch back usually it is “ALT-F1”…the “F1” is the first terminal, regardless of whether it is text-mode or GUI, the F2 is the second terminal, and so on…sometimes the GUI is at F1, sometimes at F2, and on some distributions, maybe at F7…depends on how many terminals are running and the distribution)

If you can log in, then use either ifconfig or ip -s addr show, along with route (do this on both host PC and Jetson).

Hi, I did that, by adding a new file 20-Ubuntu.conf under /etc/lightdm/lightdm.conf.d, in which I specified autologin-user=jetbot.

Problem seems to be solved. But … Let’s just leave this topic open …

If networking succeeds only after a user is logged in, then it tends to mean NetworkManager is bringing up Wi-Fi upon login. Not sure what your case is, but wired ethernet should normally not require login.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.