October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

The Linux chfn Command: Change Account Finger Information

The Linux chfn command edits account finger information such as full name, office, and phone numbers. Learn its syntax, permissions, and common read-only causes.

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 changes the finger information attached to a Linux user account: the full name, office room, office phone, and home phone. Run it without options to answer interactive prompts, or use options such as -f and -p to set fields directly. Whether a field can be changed depends on your permissions, the system’s CHFN_RESTRICT setting, and how the account is managed.

What does chfn change?

The name comes from “change finger information.” The command edits account details associated with the GECOS field in /etc/passwd. Traditionally, the finger program displays this information. The four fields are full name, office room, office phone, and home phone.

These are descriptive account details, not login credentials. Changing them does not change the username or password.

How to use chfn

The util-linux form is:

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Run man chfn on the target machine before scripting: Linux distributions may ship util-linux or shadow-utils implementations with different options.

Set fields directly

  • chfn -f "Ada Lovelace" sets your full name.
  • chfn -o "Engineering 4B" -p "+1-555-0100" -h "+1-555-0199" sets your office, office phone, and home phone.

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

Use the interactive prompts

  1. Run chfn with no field options.
  2. Enter a value when prompted to change that field.
  3. Press Enter to leave a value unchanged, or enter none to blank it.

Show help or version

For the util-linux implementation, use chfn --help for help and chfn --version for version information. Its current documentation uses -V for the version option; older releases used the deprecated spelling -v. Do not assume another implementation accepts the same options.

Who can change account information?

A regular user can generally change only their own account fields, subject to the host’s /etc/login.defs settings. The superuser can change fields for any account. When specifying another username or UID, you may need root privileges, and the account’s backend must support the operation.

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

Values cannot contain colons because colons separate fields in /etc/passwd.

How CHFN_RESTRICT affects writable fields

The CHFN_RESTRICT setting in /etc/login.defs controls which fields may be changed. In util-linux documentation, yes permits changes to office, office phone, and home phone; 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.

Why does chfn say the information is read-only?

A read-only message usually means the requested change is blocked by account ownership, insufficient privileges, CHFN_RESTRICT, or the account’s directory-service backend.

  • Confirm which account you are changing and whether you have permission to edit it.
  • Check /etc/login.defs for CHFN_RESTRICT and the fields it allows.
  • Check man chfn to identify the implementation and its rules on this host.
  • If the account is managed through LDAP or another directory service, use the supported directory-specific method if the local command cannot update it.

The util-linux manual documents exit status 0 for success and 1 for failure or invalid syntax. A nonzero result indicates the command did not complete successfully; consult its error message and the local manual for the cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does chfn work with LDAP or other non-local accounts?

The util-linux implementation can support non-local accounts, including Kerberos and LDAP entries, when it is linked with libuser. Without that support, use the directory’s designated tool, such as ypchfn or lchfn, or another tool supplied by the vendor. Support depends on the installed implementation and system configuration, so the command name alone does not guarantee that a directory account can be edited.

Why chfn behaves differently across Linux systems

Linux distributions may provide either util-linux or shadow-utils versions of chfn. Options and behavior can differ, particularly for non-local accounts and version reporting. For dependable commands, check the target host’s man chfn rather than relying on syntax copied from another distribution.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.