TIL #25 - 2019-01-26

Published on 2019-01-26

Today I learned how to change a username on a Linux system. This might not be the biggest discovery in the history of mankind, but it is very useful anyway!

I installed Noobs on a new RaspberryPi this and the default user is called pi - I could just use the default but I find it way more easy to use the same username on all my machines.

Using the same username also makes et easier to connect with ssh. The command doesn't need to include the username if it is the same as your current. ssh mbanzon@$PI2 vs ssh $PI2.

This article describs the process:

  • Rename user
  • Rename user group
  • Rename user home directory

The only thing I found missing was if the user was setup to use sudo without password - at least this no longer works on the new RaspberryPi (it doesn't really matter - using the password makes the sudo feel a bit more secure).