Jump to content

Recommended Posts

Posted

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

 

Posted

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.

Posted

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.

 

Posted

@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.

Posted

Thank you

The case is as you properly described.

According to my knowledge only the RPi allows to issue the "sudo" cmd without prompting for "root" password.

In my case ("Armbian") after "sudo" I have to in the "root" password.

Do you agree?

 

Posted

sudo prompts for the users password (not roots password) - that is the whole point of sudo, allowing a user with sudo privilege to issue commands as root, but first requiring they re-authenticate themselves.

Posted (edited)

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
Posted

Thank you, Clear, now. Apologies for the mistake.

In case there is no chance to login, is there a recovery procedure?

Maybe using another OPi and a SD card reader? Is it possible to access the file system in that way?

Thank you,

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