canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.76k stars 642 forks source link

Password For Root / User #3461

Closed CooperDActor-bytes closed 5 months ago

CooperDActor-bytes commented 6 months ago

Okay, now I have screwed my self up

I wanted to install some docker containers or a vm on a vm (Linux on Mac linux on Mac)

I have put this code passwd -e ubuntu sudo reboot and of course I am locked out is there a default password as I needed a password for su all of this from openwrt on ubuntu on ubuntu on Mac M2

Any suggestions as I have ran CasaOS on it Thanks Cooper

(BTW this was all an accident I am 12 and running with linux for fun and APT and hate that I have to put in sudo so su would have done it for me thanks Cooper)

current passwords attempted to use

1908 (I mashed my keyboard) 1111 aaaa 1234

ricab commented 6 months ago

Hi @CooperDActor-bytes, I just tried your scenario and, although SSH can authenticate (with keys), the system asks for a password renewal as soon as you login and prevents you from moving on. Short of mounting the filesystem on the host or manually messing with the VM boot procedure (which multipass does not support), I am afraid you've locked yourself out of the VM :frowning:

The best that I can suggest if that you create a new VM and start from scratch, taking snapshots now and then, so that you can restore them if necessary.

CooperDActor-bytes commented 5 months ago

aah dang cheers anyways I will start taking snapshots from now on

cheers Cooper

ricab commented 5 months ago

Sorry that I couldn't help you more. I hope things go smoothly for you now :)

CooperDActor-bytes commented 5 months ago

I found the solution to set a root password

Update and upgrade Apps sudo apt update && sudo apt upgrade

Enter Root sudo su

And set a password passwd

and enter a password to remember

and for the user

Exit root

exit

set the password

Sudo passwd

and set your password to remember

that how you set a password for a VM

Kind Regards Cooper D'Andilly 12yo Dev and Bug crusher