Enter “recovery mode” from grub and fix the problem.
Advanced options for Ubuntu
Ubuntu, with Linux x.y.z-t-generic (recovery mode)
- In the recovery menu, select
root Drop to root shell prompt
- Press [Enter] if prompted
- Type the following commands:
# Configure the keyboard layout loadkeys fr # Mount the root partition in read/write mode mount -rw -o remount / # Fix the problem. Here are some examples: # Reset the password (yes, it's that easy) passwd <username> # Fix a (terrible) mistake in .bashrc vim /home/<username>/.bashrc # etc. # Sync the changes to the disk and reboot sync reboot