Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Linux chfn command changes the finger information attached to an account: its full name, office room, office phone, and home phone. Run it without options to answer prompts, or pass options such as -f and -p to set specific fields. What you can change depends on your permissions, the local CHFN_RESTRICT setting, and which chfn implementation your system provides.

What does chfn do?

chfn means “change finger information.” It edits account details traditionally stored in the GECOS field of /etc/passwd and displayed by the finger program. The fields are identity and contact details, not the account’s login name or password.

  • Full name
  • Office room or location
  • Office phone
  • Home phone

How to use chfn

In the current util-linux syntax, the command is:

chfn [-f full-name] [-o office] [-p office-phone] [-h home-phone] [-u] [-V] [username|UID]

To change your own information, run chfn followed by the fields you want to set:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
# Change your own full name
chfn -f "Ada Lovelace"

# Set office, office phone, and home phone
chfn -o "Engineering 4B" -p "+1-555-0100" -h "+1-555-0199"

# Open the interactive prompts
chfn

The field options are -f for full name, -o for office, -p for office phone, and -h for home phone. Use quotes around values containing spaces so the shell passes each value as one argument.

Use the interactive prompts

With no field options, chfn prompts for the available values. Press Enter at a prompt to leave that value unchanged; enter none to blank it. Interactive mode is useful when you want to review each field rather than provide several options in one command.

Change another user’s details

You can specify a username or UID after the options, but ordinary users generally may change only their own account. The superuser can change fields for any account. For example, an administrator can run chfn -f "Ada Lovelace" username, replacing username with the target account. Whether the requested field is writable still depends on local policy.

Why does chfn say the information is read-only?

A read-only error usually means the caller or the system policy does not permit changing that field. Ordinary users are limited to their own account and remain subject to /etc/login.defs; the superuser may edit any account. Field restrictions can also prevent a permitted user from changing particular values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check CHFN_RESTRICT

The util-linux implementation uses CHFN_RESTRICT to control writable fields. When set to yes, only office, office phone, and home phone are allowed; no also permits the full name. The field abbreviations are f (full name), r (office room), w (work phone), and h (home phone). If CHFN_RESTRICT is undefined, the util-linux manual says all finger information is read-only by default. Check the setting in /etc/login.defs and consult the host’s man chfn for the behavior of its installed implementation.

Check the value and account type

Values must not contain colons because colons delimit fields in /etc/passwd. If the target account comes from LDAP, Kerberos, or another directory service, the local command may also lack a backend capable of editing it. In that case, use the directory service’s supported management method or the vendor-specific command.

Does chfn work with LDAP?

It can, depending on the build and account-management setup. The util-linux implementation supports non-local entries such as LDAP and Kerberos when it is linked with libuser. Without that support, use a directory-specific implementation such as ypchfn, lchfn, or another tool supplied for the environment. A command that works for local /etc/passwd accounts may therefore fail for a directory-managed account.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which chfn version is installed?

Linux distributions may provide either util-linux or shadow-utils chfn, and their options are not guaranteed to match. Check man chfn on the target host before relying on a particular option in a script. Current util-linux documentation uses -V for version; older releases used deprecated -v. You can display help or version information with:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chfn --help
chfn --version

Exit status

The util-linux command returns 0 on success and 1 for failure or invalid syntax. In a script, check the status and treat a nonzero result as a failed update rather than assuming the requested field changed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.