0

When I installed Ubuntu Studio 19.10, I didn't add password for login. Now anytime I try to do something with the terminal it asks for my sudo password but of course I have no way of finding out what that is, since: a) GRUB does not appear for me at all when I boot system b) I cannot open etc/sudoers

Totally new user...have installed Ubuntu in light of world events, covid and love for open source community. THANK YOU!

2 Answers2

0

If you have installed it very recently, i could suggest you to reinstall it(formatting and install again) or try to enter to the instalation and "repair" your actual version.

If you do this, try to add a password to the user, one easy for you to remmember, so you can have it easily(and dont have this problem again)

About the GRUB, i cant help you. I have a grub because i installed linux having windows in another partition.

Munsko
  • 245
0

1. Start your machine in recovery mode -> Resume to normal boot. You should get a prompt with root. Follow the steps below:

root@demo:~$ mount -o remount,rw /

root@demo:~$ passwd yourusername
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

root@demo:~$ reboot

2. You can use chroot. Start your machine with Live CD/DVD/USB

Start a terminal and mount your root disk as per the following steps below

Check which is your root disk? :

ubuntu@demo:~$ sudo fdisk -l

Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

Disposit.     Start     Final  Sectores  Size Tipo
/dev/sda1      2048    391167    389120  190M EFI System
/dev/sda2    391168  58660699  58269532 27,8G Linux filesystem
/dev/sda3  58660864 234440703 175779840 83,8G Linux filesystem

In this case my root disk is /dev/sda2

ubuntu@demo:~$ mkdir disk
ubuntu@demo:~$ sudo mount /dev/sda2 disk

You can check the files to ensure it's the root partition

ubuntu@demo:~$ sudo ls disk 
bin    dev    home        lib     media  proc  sbin  sys  var
boot   initrd.img      lib64      mnt    root  snap  tmp  vmlinuz
cdrom  etc    initrd.img.old  lost+found  opt    run   srv   usr  vmlinuz.old

ubuntu@demo:~$ sudo chroot disk 

Enter "passwd" command followed by your username

root@demo_chroot:~$ passwd yourusername
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Exit from chroot

root@demo_chroot:~$ exit

Finish unmounting and reboot

ubuntu@demo:~$ sudo umount disk
ubuntu@demo:~$ reboot