Skip to content

Instantly share code, notes, and snippets.

@cellcoresystems
Created March 28, 2021 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cellcoresystems/c96b1880ca7a41e732bd13645a42d387 to your computer and use it in GitHub Desktop.
Save cellcoresystems/c96b1880ca7a41e732bd13645a42d387 to your computer and use it in GitHub Desktop.
Rename default user in Crostini

Rename the default user in Crostini

Crostini is the Linux (LXD, a project initiated by Ubuntu publisher Canonical) container for ChromeOS. When enabled it creates a new container with the hostname "penguin" and an initial user whose user/login name is derived from the Gmail alias of the logged in Google account.

This is incovenient for a lot of reasons, not the least of which is that it makes working with NFSv3 shares and ssh keys on and for other hosts tedious (userids are everything to NFSv3, as login names are for ssh).

These are the steps to rename that default user and group:

In what follows "oldusername" is your existing username in penguin, while "newusername" is what you want it to be.

  1. Enter crosh with Ctrl-Alt-t
  2. Start terminal session with
vmc start termina
  1. Log into penguin container as root:
lxc exec penguin -- bash
  1. Run these commands:
killall -u oldusername
groupmod -n newusername oldusername
usermod -md /home/newusername -l newusername oldusername
usermod -aG users newusername
loginctl enable-linger newusername
  1. Shutdown the container:
shutdown -h now
  1. Close crosh and fire up the Linux console

The first time you do this it may crash (it did for me), but the second time it should open with your new username in the prompt.

Reference: https://www.reddit.com/r/Crostini/wiki/howto/change-default-username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment