First, you have to reboot into recovery mode.
If you have a single-boot (Ubuntu is the only operating system on your computer), to get the boot menu to show, you have to hold down the Shift key during bootup.
If you have 亚游app集团下载a dual-boot (Ubuntu is installed next to Windows, another Linux operating system, or Mac OS X; and you choose at boot time which operating system to boot into), the boot menu should appear without the need to hold down the Shift key.
From the boot menu, select recovery mode, which is usually the second boot option.
2) mount -o rw,remount /
3) passwd r亚游app集团下载oot
Th亚游app集团下载e root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal.
In recent versions of Ubuntu, the filesystem is mounted as read-only, so you need to enter the follow command to get it to remount as read-write, which wi亚游app集团下载ll allow you to make changes:
mount -o rw,remount /