Jetson TX2 password

So it has been a while since I’ve used my board and i seem to not get the correct password to install packages and stuff into the board. Does anybody know how can I get it back?

User “nvidia” should be pass “nvidia”, user “ubuntu” should be pass “ubuntu”. If either of those can be logged in to, then you can use sudo to change the password of the other.

If you’ve customized passwords and can no longer remember for one of those two accounts, then your options are limited to some fairly time-consuming methods to change it. You could flash your board and start over fresh. Alternatively, you could clone your Jetson, place the password files on top of the loopback mounted clone using the sample rootfs (which would reset passwords), and then flash the Jetson using the clone instead of a new image (you’d preserve everything on your Jetson, but you’d still be essentially flashing…this isn’t fast to clone and flash).

Are you able to log in to either user ubuntu or nvidia? Do you need info on cloning?

Awesome! I tried this and I was able to get my password back! thank you!

When I prepare to install JetPack-L4T-3.2.1-linux-x64_b23.run for Jetson TX2, it requires to have root authorization to establish a folder such as JetPack in the main directories including /bin, /home, /opt. Without root authorization, the system does not allow to establish the folder of JetPack. How can I get the root authorization or password?

Thanks in advance,

Most Linux distributions just use an account “root”, and then there are two ways to get root authority (“authority” is what matters): 1, direct login as “root” with root’s password, or 2, a regular user using the “sudo” command with that user’s password (not root’s password). For this latter to work the user must be considered an “administrator”. In the case of releases prior to R32.1 (SDK Manager 4.2 installs R32.1), then the accounts “ubuntu” and “nvidia” are both administrators. Using sudo with those names temporarily turns you into root. These accounts are the ones the password is for.

E.g., as “ubuntu” you can run “sudo ls” and run “ls” as root. The prompted password is that of “ubuntu”.

The default password of ubuntu and nvidia are “ubuntu” and “nvidia” (be sure to change these if your device is going to touch an outside network without a router or firewall to protect it).

Ubuntu locks root login and so you cannot directly log in as root.

Hi. Could you help me please, someone changed password on my jetson due to i opened remote access. But i need to restore data. You said :

place the password files on top of the loopback mounted clone using the sample rootfs (which would reset passwords)

I made a clone of my jetson using this command:
sudo ./flash.sh -r -k APP -G backup.img jetson-tx2 mmcblk0p1
but don’t understand how to do next step… Could you explain in more detail?

This clone means you will have both “backup.img” and “backup.img.raw”. So long as you keep a safe copy of the “backup.img.raw” you are free to make attempts and fail without really losing anything. You might find some frustration with the complication which follows, but with a safe copy of the clone, you are not at risk of losing anything and trying this until it works. If something fails, then you can ask more based on that method.

The “.img” file (the sparse file) is mostly without use, and it can be flashed, but has no other use. The “.img.raw” file (the “raw” file) is quite useful (and large, about 30GB). I personally discard “backup.img”, but keep “backup.img.raw”. Either of these, if renamed “system.img”, and placed in the “bootloader/” subdirectory, along with using the “-r” option to flash.sh can be used for flashing. Thus if you manipulate or edit the “.img.raw” file, then this is the rootfs which gets flashed.

An example:

cd /where/ever/it/is/at
# "/mnt" is just a traditional place to mount drives for some uses, you can use any tmp location.
sudo mount -o loop backup.img.raw /mnt
cd /mnt/etc
ls
# ...now edit or change files...
cd
sudo umount /mnt
cp /where/ever/it/is/backup.img.raw /where/ever/else/Linux_for_Tegra/bootloader/system.img
cd /where/ever/it/is/backup.img.raw /where/ever/else/Linux_for_Tegra/
# Put Jetson in recovery mode and micro-B USB connected.
sudo ./flash.sh -r jetson-tx2 mmcblk0p1

After this the Jetson will be running with the original rootfs, but altered exactly as you’ve altered the loopback “backup.img.raw”. If you have made repairs to password related files, then those repairs will exist in the final flashed rootfs. Please beware that this is an enormous file, and file copy will take a lot of time even on a fast system. I used copy (not “mv”) from “backup.img.raw” to create “system.img” because forgetting to use “-r” will overwrite the “system.img”, essentially deleting the old “system.img”. Copy implies that if you make this mistake you still have the original “backup.img.raw”. Two copies of a 30GB file implies 60GB of disk space…be careful to have enough available disk space before doing this.

Understand that if you do not use the “-r” option to “flash.sh”, then the “Linux_for_Tegra/rootfs/” directory is used to create the “system.img” every time you run flash.sh (thus overwriting the original “system.img”). Normally the “system.img” is a near copy of “rootfs/”, and this in turn is via a sample Ubuntu rootfs with some NVIDIA drivers added to it. Previous information talks about using your clone in place of “system.img”, but you could alternately accomplish this as follows: Place a loopback image over the “rootfs/” directory (making your clone the source of a new image instead of a sample rootfs), and then flashing while leaving out the “-r” option. Some “/boot” files would be updated on the loopback mounted image, and a new image would be generated, but that image would essentially be your clone.

If you happen to have a valid version of the password files, and copy those to your clone, followed by flashing in any way which uses that clone, then it should “just work” upon boot. The trick is in choosing how to put correct password files in place.

There had been a script available for Jetson to pre-generate the admin password into “rootfs/” (or a loopback clone if mounted there), but the new forum software seems to have altered my list of URLs. Would anyone here happen to know what URL to get the “generate passwords before flash” script? This would be the easiest way to do it. If not, then read on…

If you do not have a script to generate the login password, then you can first flash your Jetson normally, do the one-time login setup of password, and copy those files back to your host PC to replace those on the clone. Steps above for flashing the clone would create this (be sure to maintain correct file permissions).

Candidate files you would choose to copy from a default install and first boot setup (if not generated by a script), would be:

/etc/passwd
/etc/passwd-
/etc/group
/etc/group-
/etc/shadow
/etc/shadow-
/etc/gshadow
/etc/gshadow-

2 Likes

Hi. Thank you very much for help, i did it :)