TNSR Operating System Account Recovery / Password Reset¶
Certain situations may require recovering access to an operating system account without reinstalling TNSR. For example, if no accessible account on the installation has administrative access. Passwords can be reset from the system console (video or serial) to regain access.
Tip
If any user has administrator access via sudo
, they can reset an account
password via the shell without following these instructions.
Check Boot Order¶
Some devices may not be set to boot TNSR as the first priority, which can make this process more difficult. So before making any other changes, ensure TNSR is set to be the first boot option.
Note
The exact procedure varies widely by hardware, and not all hardware has such options. If the device boots TNSR during a regular boot, in many cases these steps can be skipped.
Connect to the console
Boot the device
Enter the system BIOS
Note
The key for this action varies by hardware and is typically displayed during the boot process. Common keys to enter the BIOS are
Del
orEsc
.Navigate to Boot options
Ensure TNSR (Ubuntu) is listed as the first option
Save changes and exit
Boot Recovery Mode¶
Starting recovery mode varies slightly by console type.
Highlight Advanced options for Ubuntu on the Grub menu
Press
Enter
to display the Advanced options menuHighlight the option for Recovery Mode under the default entry (typically the most recent/highest numbered kernel)
Choose the tab for the appropriate console type and follow the remaining steps:
Serial consoles require adding the console to the kernel boot command line:
Press
e
to edit the boot configurationNavigate to the end of the line which starts with
linux
and also mentionsrecovery
Add the console to the end of the command line, for example:
console=ttyS0,115200n8
Note
The actual console varies by hardware. For example, most use
ttyS0
but some like the Netgate 4200 usettyS4
.Make sure there is a space before the
console=
keyword.
Press
Ctrl-X
to boot using this command
On video consoles the menu entry will work without any other changes:
Press
Enter
on the Recovery Mode menu entry
Reset the Password¶
Now use the recovery menu to start a root shell and reset the account password.
From the recovery mode menu:
Highlight the Drop to root shell prompt option
Tip
If the menu is not legible, press
Ctrl-L
to redraw the screen.Press
Enter
Press
Ctrl-D
to continue when promptedWarning
If this action prompts for a password and will not continue, then someone set a password for the
root
account which is non-standard. That requires a different method to recover not within the scope of this document.Type
passwd <user>
where<user>
is the username to reset, such astnsr
Press
Enter
Enter and confirm the new password
Type
exit
and pressEnter
to return to the recovery menuHighlight Resume Normal Boot
Press
Enter
TNSR will reboot normally from this point and the new password will work for the recovered account.