On a typical Linux system, which tools can be used to add a new local user account named 'Amit' (considering common distributions and admin utilities)?

Difficulty: Easy

Correct Answer: All of the above

Explanation:


Introduction / Context:
Linux provides multiple administrator tools to create local users. Depending on the distribution, there may be both low-level commands and higher-level wrappers or configuration utilities. Understanding these options helps when working across diverse environments and historical systems.


Given Data / Assumptions:

  • Goal: create a local user 'Amit'.
  • Distribution may offer both useradd (low level) and adduser (friendlier wrapper).
  • Legacy tools like linuxconf existed historically on some RPM-based systems.


Concept / Approach:

useradd is a standard low-level utility that creates the account and can set default shell, home directory, UID/GID options. adduser (Debian/Ubuntu and some others) is a friendlier front end that prompts interactively and then calls useradd under the hood. Older administrative tools (e.g., linuxconf) also provided account management through a TUI/GUI.


Step-by-Step Solution:

Create with useradd: sudo useradd -m -s /bin/bash amit; then set password with sudo passwd amit.Create with adduser (where available): sudo adduser amit and answer prompts.Legacy: linuxconf offered a menu-driven approach to add accounts.


Verification / Alternative check:

Confirm with getent passwd amit and check /home/amit. Verify group membership via id amit.


Why Other Options Are Wrong:

  • Each single option alone is incomplete because all listed methods can add users depending on distro/tools.
  • None of the above is wrong since the listed methods are valid.


Common Pitfalls:

  • Forgetting -m to create a home directory when using useradd (if not defaulted).
  • Assuming adduser exists on all distros; it may not.
  • Neglecting to set initial passwords or groups (sudo wheel group, etc.).


Final Answer:

All of the above.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion