Update user account information in Ubuntu

A user account can be created using adduser command-line utility. Check the highlighted link to know more. While adding a user, it prompts us for information like – Full Name of the user, Room Number, Work and Home phones. And, that is basically the user account information we are writing about. And, here we cover how update it using chfn command-line utility.

Once a user is created, we may want to update his/her user account information for various reasons. Some error may have crept-in the first time we entered the text. Or, a user wishes to get his details updated. Do check Additional Info section for viewing user account information once its gets updated.

Note: Following operations with chfn require superuser privileges. Contact your System Administrator for assistance, if you don’t have the privileges.

Update user account information in Ubuntu

Barring Full Name, a regular user can change his/her user account information through chfn command-line utility. So, just enter you own password and use the following command to update the information (If you don’t wish to update to any field then, leave the section unchanged and press Enter for next field)-

chfn <user_name>

One thing that you notice here that, we get the option to update Full Name filed. Even if we try to update Full Name of our own account, it throws a permission denied error.

chfn -f <user_name>

It returns with –

chfn: Permission denied.

So, with sudo (or superuser privileges), we can update Full Name in user account as well.

sudo chfn <user_name>

Here, it would prompt us to update for Full Name, Work Phone etc.

In conclusion, we have covered how to update user account information in Ubuntu.

Additional Info –

Once we have updated the account information, the next comes how to view it. This can be done through command-line utility finger. If its not there then, we need to install it first.

sudo apt update
sudo apt install finger

Thereafter, to get user account information –

finger -s <user_name>

and, we can also use –

finger -l <user_name>