Recommended Free Tools
On a CentOS Linux 8 server, create a local account with useradd, set its password with passwd, and add it to wheel only when administrative access is required. Remove just the login with userdel, or remove the login, home directory, and mail spool with userdel -r. CentOS Linux 8 reached end of life on December 31, 2021, so treat these commands as legacy-system maintenance and plan migration to a supported operating system.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Before changing accounts: confirm the server and your authority
This procedure applies to CentOS Linux 8. It assumes you have root access or an account with equivalent sudo permission. Red Hat’s RHEL 8 command-line account procedure has the same basic tools, but local policy, authentication configuration, and installed packages can change the result.
As an Amazon Associate I earn from qualifying purchases.
CentOS Linux 8 stopped receiving content updates on December 31, 2021. The CentOS Project archives its content, and an Internet-facing host that still runs this release should be placed on a migration plan. Account administration still works, but you should not interpret a successful command as evidence that the operating system is supported or secure.
Use an exact username
Linux account names are case-sensitive in practice and are referenced by services, file ownership, scheduled jobs, and SSH configuration. Copy the name from the request or an approved change record rather than typing an approximate spelling. Do not reuse an existing service account for a person.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Check what a deletion would affect
Before removing an account, determine whether it owns a systemd service, cron entry, SSH key, application configuration, uploaded files, database data, or files outside its home directory. Decide whether the organization must retain, transfer, or destroy that material. A recursive deletion is irreversible unless you have a verified backup.
End active sessions before deletion
If the account is logged in, terminate its sessions after you have confirmed that doing so will not interrupt a production task:
Free tools Windows power users keep installed
One-click scans. No signup required.
sudo loginctl terminate-user <username>
Check the result with your normal session and process-monitoring tools. Terminating a session does not by itself remove the account or its files.
How to add a local user
The documented command form is useradd [options] username. A simple local account can be created and given a password as follows:
sudo useradd <username>
sudo passwd <username>
passwd asks for the new password twice. Apply the password length, history, expiry, and complexity rules required by your site; the command itself does not define an organization’s password policy.
Choose the home-directory behavior deliberately
On many CentOS installations, the system defaults create a home directory and populate it from /etc/skel. A commonly used compatible command is:
sudo adduser <username>
That command creates /home/<username> and copies starter files from /etc/skel when the host’s defaults permit it. CentOS systems may provide adduser as a wrapper or compatible interface for the same account database. Use one command style consistently on a given host, and verify the result instead of assuming that a home directory was created.
If your local policy disables automatic home creation, use the appropriate useradd option for that policy (commonly -m) and then verify the directory and its ownership. Do not manually create a home directory with broad permissions as a substitute for checking the host’s account defaults.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Verify the account and its home
Run all three checks while logged in as an administrator:
id <username>
getent passwd <username>
ls -ld /home/<username>
The id output shows the numeric UID and group memberships. getent passwd confirms that the account resolves through the system’s configured name-service sources, and ls -ld shows whether the expected home directory exists and who owns it. Red Hat specifically documents id <username> as the basic verification command; the other two checks make home-path and name-service problems visible.
Understand local password access versus SSH access
Setting a local password does not guarantee that the user can log in over SSH. If the SSH daemon disallows password authentication, the new password will be rejected even though it is valid. Install an approved public key, place it in the user’s ~/.ssh/authorized_keys with restrictive ownership and permissions, and confirm the server’s sshd authentication policy separately. DigitalOcean’s 2020 account-management guidance makes the same distinction: a server that disallows password-based authentication will not accept the new username through password login.
How to give a CentOS user sudo access
Use the administrative wheel group when the user needs full sudo rights. Append the user to the group without replacing existing supplementary groups:
sudo usermod --append -G wheel <username>
The --append option matters. Omitting it while supplying -G can replace the account’s existing supplementary-group list, which may break access to shared resources.
Confirm that the wheel rule is enabled
Open sudoers with the syntax-checking editor:
sudo visudo
Ensure the standard rule is present and not commented out:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute%wheel ALL=(ALL) ALL
visudo checks syntax before installing the file, reducing the risk of locking administrators out with a malformed edit. Do not edit /etc/sudoers with a general text editor when visudo is available.
Test as the target user
The group change is normally picked up on the user’s next login. Test from a fresh login or a controlled impersonated shell:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
sudo -iu <username> sudo whoami
The expected output is root. If the test fails, check that the account is actually in wheel with id <username>, that the wheel rule is enabled, and that you are not testing an old session whose group list predates the change.
Decide what “delete the user” means
There are two materially different operations. Removing the account record while retaining files is appropriate when data must be reviewed, archived, reassigned, or preserved for an application. Recursive removal is appropriate only after the retention decision has been approved.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Goal | Command | What happens | What you must still check |
|---|---|---|---|
| Remove login, retain data | userdel <username> |
The account entry is removed; the home directory and user-owned files remain. | Archive, reassign, or delete retained files according to policy; search for ownership outside the home directory. |
| Remove login and home data | userdel -r <username> |
The account, home directory, and mail spool are removed. | Confirm the username, backup status, active sessions, service dependencies, and any SELinux or desktop-account metadata. |
| Remove an administrator | Either command above, after removing unnecessary wheel access |
The account is treated like any other local account; group membership does not change deletion semantics. | Check sudoers drop-ins, automation credentials, SSH keys, and emergency access procedures. |
Inspect processes and files first
Look for running processes and files owned by the account before selecting a deletion mode:
sudo ps -u <username>
sudo find / -xdev -user <username> -ls 2>/dev/null
The filesystem search is limited to the current filesystem with -xdev; repeat it for mounted filesystems that may contain application data. Also inspect service unit files, timers, per-user cron entries, deployment jobs, and SSH key locations. A home-directory deletion does not remove an account’s ownership from files stored elsewhere.
How to delete a user but keep the home directory
After checking dependencies, backing up required data, and terminating active sessions, remove only the account record:
sudo loginctl terminate-user <username>
sudo userdel <username>
userdel <username> leaves the home directory, mail spool, and other files in place. Their numeric UID ownership remains visible even though the username no longer resolves. This is useful when another administrator must review the material or when files will be transferred to a replacement account.
Archive or reassign the retained files
Apply your retention policy immediately so abandoned data does not become an untracked security liability. For example, an approved archive workflow might create a protected archive of a retained home directory:
sudo tar -C /home -czf /root/<username>-home.tar.gz <username>
Store the archive only where your backup and access-control policy permits. If another account must own the files, review each path before using chown; blindly changing every file can alter application behavior or expose secrets. Remember that files outside /home/<username> require separate review.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
How to delete a user and all of its home data
Use the recursive form only after the account name, backup decision, service impact, and session status have been checked:
sudo loginctl terminate-user <username>
sudo userdel -r <username>
The -r option removes the account, its home directory, and its mail spool. It does not mean “find every file on the server owned by this UID”; files outside the home directory can remain and must be handled separately.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Handle SELinux and AccountsService metadata when present
Red Hat’s fuller RHEL 8 procedure uses the SELinux-aware form:
sudo userdel --remove --selinux-user <username>
On systems that maintain AccountsService user metadata, remove the corresponding record after confirming that it exists:
if [ -e /var/lib/AccountsService/users/<username> ]; then
sudo rm -f /var/lib/AccountsService/users/<username>
fi
Do not remove unrelated files from /var/lib/AccountsService/users. The metadata cleanup is conditional because not every CentOS server has AccountsService installed or a record for the account.
Verify that removal succeeded
Check name-service resolution after either deletion mode:
getent passwd <username> || echo 'account removed'
id <username>
After successful removal, getent passwd should produce no account entry, and id should fail with a “no such user” style error. That failure is expected and is not evidence that the command malfunctioned.
Check for leftovers
- Repeat the ownership search on each relevant filesystem to find files that still carry the old UID.
- Confirm that no processes remain under the old account and that no systemd unit or timer is configured to run as it.
- Review scheduled jobs, SSH authorized keys, application secrets, deployment agents, and backup definitions.
- Inspect authentication and change logs, and preserve the record required by your audit policy.
If the account was removed with userdel rather than userdel -r, the home directory should still be present by design. If it was removed recursively but files remain elsewhere, that is also expected; the recursive option is scoped to the home directory and mail spool.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Troubleshooting common account-management failures
“User already exists” from useradd
Check both the local database and configured name-service sources:
getent passwd <username>
id <username>
If the account is legitimate, do not create a second spelling or edit /etc/passwd manually. If the account is an abandoned service identity, follow the deletion and ownership review process rather than forcing a replacement.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →The account exists but has no usable home directory
Compare the passwd entry’s home path with the filesystem:
getent passwd <username>
ls -ld /home/<username>
Check the host’s account-creation defaults and whether /etc/skel is available. Create or repair a home directory only through an approved administrator procedure, then set ownership and permissions appropriate to the application; do not expose a user’s private files with world-writable permissions.
The password works locally but SSH login fails
Check whether PasswordAuthentication is disabled or another SSH policy rule restricts allowed users and groups. If password login is intentionally disabled, use the approved public-key process and verify authorized_keys ownership and mode. Changing the local password does not override the SSH daemon’s authentication methods.
Sudo reports that the user is not allowed
Verify group membership, start a fresh login, and inspect sudoers with visudo. The account must be in wheel, and the %wheel ALL=(ALL) ALL rule must be enabled. A syntax error or a conflicting drop-in can change the effective policy.
Outdated 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 matchWindows 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 reinstalluserdel reports that the account is busy
Find the user’s processes with ps -u <username>, terminate the login session with loginctl terminate-user <username>, and stop any service that intentionally runs under that identity. Recheck the process list before retrying. Killing an unknown production process without identifying its owner and purpose can cause an outage.
Files remain after deletion
This is normal for account-only deletion and for files stored outside the home directory. Use the ownership search, identify each path’s purpose, and archive, transfer, or remove it under a separate approved change. Never assume that an unresolvable username means the data is safe to delete.
Operational practices for a legacy CentOS 8 host
Keep account changes small and auditable: record the requester, exact username, reason, commands run, backup or retention decision, verification output, and administrator identity. Prefer named personal accounts with narrowly justified wheel membership over shared administrator logins. Remove unused SSH keys and sudo access promptly, and review service accounts separately from human accounts.
Finally, place migration on the operating plan. CentOS Linux 8 has no further content updates after its December 31, 2021 end-of-life date. Test the application and account model on a supported operating system, document how UIDs, groups, SSH keys, sudo policy, SELinux labels, and retained files will be transferred, and schedule the cutover before relying on this legacy server for new workloads.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteQuick 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.




