Jump to content

Reset password root


xatatol160

Recommended Posts

I have a mini computer with ubuntu installed, I forgot my system password, how can I restart it?
The Mini PC does not use grub, only U-boot
I ran the printenv command and I wonder where I should add the variable to be able to change the root password

 

boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc1 mmc0 usb0 pxe dhcp
bootargs=storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal androidboot.dtb_idx=0 androidboot.dtbo_idx=0
bootcmd=boot_fit;boot_android ${devtype} ${devnum};run distro_bootcmd;
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=0
cpu=armv8
devnum=0
devtype=mmc
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi

 

Link to comment
Share on other sites

I wonder if this may help from a u-boot cheat sheet I found at http://nerveware.org/u-boot-cheat-sheet/1.html

 

Boot into single user mode
Single user mode is mostly used to reset forgotten passwords, but the command below might be usefull for debug purposes as well (omit init).
U-Boot > setenv bootargs "${bootargs} reboot=cold,hard emergency init=/bin/sh"

For embedded devices, the root partition is frequently mounted read only.
$ mount -t proc none /proc
$ mount -o remount,rw /
$ passwd root
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
$ sync

 

I am guessing that to do this you will need to connect a RS232 to TTL UART board to the debug serial port on the board to get to the U-Boot command prompt. I've yet tried this method on my board, but I have got myself to the U-Boot>_ prompt.

Link to comment
Share on other sites

Hi, is the single user login an option with Orange Pi?

I need to recover the root password.

I'm used to login as a user and I can't figure out the root password anymore.

 

Is it possible to remove the password so to recover setting a new one at next bootstrap?

 

Thank you,

Best regards, S.

 

ps: in case it helps, I can load an image to an additional SD card, boot and log as root so to try to modify the former SD connected with a USB reader/port.

 

Link to comment
Share on other sites

@SergioAiello  If I understand you correctly, you still have access to the system via a regular user account.  It is likely that this regular user account was the one created during your first boot, in which case that user will have sudo permissions.  So you can sudo su root to become the root user, and from there you can reset the root password.

Link to comment
Share on other sites

I mean if i need to launch or open a file owned by root (I write:  -> sudo <filename>) then I am asked to insert the root password.

Unfortunately I can't modify the file "passwd". I can only open it in "read-only" mode.    

But also if I write "su" I'm prompted to insert the root password.

How can I reset root password?

thank you.

Edited by SergioAiello
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines