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:
Recommended Free Tools
#1 Best Overall
# 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.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchCheck 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.
Rank #4
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.
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.
Best Value
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.
Quick Recap
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.

