in Sysadmin

Renaming default username in Raspian (on RaspberryPi)

When you install Raspbian on RaspberryPi, default username is pi. Often, you want to change it to custom username (and keep uid 1000). Here’s how to change it, along with user’s home directory:

usermod -l new_username -m -d /home/new_username pi
  • -l new value of the login name
  • -m move contents of the home directory to the
    new location
  • -d new home directory for the user account

Also, change default user’s group name:

groupmod -n new_username pi

To successfully change it, pi user can’t be logged in. You have to log in as root (or another user in sudo group) and execute above commands.

Write a Comment

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.