ChromeOS, Linux environment and sudo password

The Linux environment has been a part of my computer workflow for years.

In my personal life, I use macOS, which allows me to leverage the terminal to extend my possibilities beyond the graphical user interface (GUI).

At work, I use Windows devices. Through the Windows Subsystem for Linux, I can also use Linux on these machines.

Recently, as part of my work with Chromebooks, I decided to leverage the power of the Linux terminal there as well.

I’ve just installed the Linux environment through the Developer option on ChromeOS Flex and opted to install a package manager to facilitate adding necessary software.

On Windows 11, I use the Ubuntu environment, which is based on Debian. Since I’ve learned Debian over the years, I’m familiar with it.

ChromeOS also utilizes a Debian-based Linux environment, making them quite similar.

While working with Linux on macOS or Windows, I rely on Homebrew, aptly named “The Missing Package Manager for macOS or Linux.” It empowers me to install essential packages effortlessly.

Within the ChromeOS environment, I attempted installation as well, but encountered a minor hurdle when copying and pasting the installation command from the Homebrew website.

Initially, I encountered difficulty pasting the installation command using the paste keyboard shortcut (Ctrl+V).

I needed to head to the Terminal settings, where under Keyboard and mouse, I needed to tick the box for Ctrl+V paste behaviour. I have also enabled several others I typically use, like Ctrl+C copy behaviour.

Yet, pasting the Homebrew installation command in the penguin terminal presented another hurdle.

Homebrew isn’t recommended for installation under root privileges. Instead, it is installed as an ordinary user who belongs to the sudoers group. This grants the ability to run commands with administrator privileges using the sudo command.

ChromeOS Terminal with Linux environment

Despite being in the sudoers group by default, the installation process initially prompted me for my password.

Surprisingly, during the initial Linux environment setup, I only needed to set a username. There was no prompt for a password. I assumed my Google Account password would suffice, but I was mistaken.

Desperate for a solution, I quickly Googled “default password” and found a reference to test0000. Needless to say, it didn’t work.

Aware of how to change the password, I promptly ran the passwd command. However, to my surprise, it prompted me for the current password, which I, of course, didn’t know.

To my surprise, using sudo su in the terminal granted me elevated privileges without a password prompt.

Fortunately, gaining root privileges allowed me to change my user password using passwd user (where user is the username displayed before @penguin).

Exiting root privileges and running the Homebrew installation command again, the process completed smoothly after I entered the new password.

It may seem straightforward, but searching online often leads to irrelevant answers. This guide serves as a reminder for myself and others on how to successfully install Homebrew on ChromeOS.

Regards

Comments
Categories