How itzcinder/server-admin works
Purpose and Runtime
This is a Bash-based interactive server-administration panel for Project Nuva’s host machine. It manages local Linux identities and groups, exposes account/group inspection, and provisions predefined operational roles. It runs directly on a Linux server and operates against OS account databases and administrative commands; it is not a web application.
Entry Point and Navigation
start.sh is the executable entry point and main control loop. It presents the top-level choices—users, groups, queries, provisioning, exit—and delegates to module menus:
• start.sh
• scripts/menus/users_menu.sh
• scripts/menus/groups_menu.sh
• scripts/menus/query_menu.sh
• scripts/menus/provisioning_menu.sh
Menu scripts are the orchestration boundary: they collect interactive selections and invoke focused operation scripts rather than embedding all administration logic.
User Lifecycle Management
The user module administers local accounts through create, rename, and delete flows:
• scripts/users/create_user.sh
• scripts/users/edit_user.sh
• scripts/users/delete_user.sh
Creation validates uniqueness, collects and confirms a password, creates a /bin/bash account, and sets credentials. Editing validates account existence and blocks changes while the user has active processes; it can rename the account and optionally its home directory. Deletion similarly blocks active-process accounts and requires confirmation before retaining or removing the home directory.
Group Lifecycle and Membership
The group module manages local groups and user-to-group relationships:
• scripts/groups/create_group.sh
• scripts/groups/edit_group.sh
• scripts/groups/delete_group.sh
• scripts/groups/assign_group.sh
Group creation supports either an operator-provided GID or system allocation. Deletion is guarded by checks for primary-group dependencies and warnings about secondary memberships. Membership assignment validates both identities, avoids duplicate membership, and supports secondary versus primary-group assignment. This module is coupled to user state because group changes can affect account ownership and access.
System Query Boundary
Read-only query scripts expose Linux account and group state from native system files:
• scripts/query/query_users.sh
• scripts/query/query_users_sys.sh
• scripts/query/query_groups.sh
• scripts/query/query_groups_sys.sh
Normal-account/group views filter system identities; system views include all records. The principal data sources are /etc/passwd and /etc/group. These scripts form the observability path for verifying the state changed by lifecycle and provisioning operations.
Provisioning Policy
Provisioning applies the project’s initial server identity model:
• scripts/provisioning/setup_users.sh
• scripts/menus/provisioning_menu.sh
The setup script creates role groups (sysadmin, webadmin, dbadmin, backup, audit, users, scriptdev) and associated accounts. It encodes operational policy through primary groups, login shells—including restricted /usr/bin/rbash for the auditor—and sudo access for the administrative account. It is the highest-impact, declarative bootstrap stage and should be run with elevated privileges.
Security and Operating-System Dependencies
All mutation paths require system-level permissions and depend on Linux user/group management facilities, process-state checks, home directories, shell paths, and credential handling. Key safety boundaries are existence checks, active-process checks, dependency warnings, and explicit confirmations before destructive actions. scripts/colors.sh is shared presentation support for the interactive CLI, while authority and persistence remain entirely with the underlying host OS.
Main entry points: start.sh Main control loop · users_menu.sh Users menu · groups_menu.sh Groups menu · query_menu.sh Queries menu
Components 17
Interactive CLI
- Main control loop · Routes top-level administration choices.
start.sh - Users menu
scripts/menus/users_menu.sh - Groups menu
scripts/menus/groups_menu.sh - Queries menu
scripts/menus/query_menu.sh - Provisioning menu
scripts/menus/provisioning_menu.sh - CLI presentation
scripts/colors.sh
User management
- Account lifecycle · Create, rename, and delete local accounts with safety checks.
scripts/users/create_user.sh - Account editing · Renames accounts and optionally home directories after process checks.
scripts/users/edit_user.sh - Account deletion · Requires confirmation and blocks accounts with active processes.
scripts/users/delete_user.sh
Group management
- Group lifecycle · Creates, edits, and deletes local groups with dependency safeguards.
scripts/groups/create_group.sh - Group assignment · Assigns secondary or primary groups after identity validation.
scripts/groups/assign_group.sh
Read-only queries
- Account views · Normal and system account listings.
scripts/query/query_users.sh - Group views · Normal and system group listings.
scripts/query/query_groups.sh
Provisioning
- Role bootstrap · Creates predefined roles, accounts, shells, and administrative access.
scripts/provisioning/setup_users.sh
Other components
- Linux identity state · Local account databases, homes, process state, credentials, and admin commands.
- Account database
- Group database
Connections 22
- Main control loop → Users menu: users
- Main control loop → Groups menu: groups
- Main control loop → Queries menu: queries
- Main control loop → Provisioning menu: provisioning
- Users menu → Account lifecycle: create
- Users menu → Account editing: edit
- Users menu → Account deletion: delete
- Groups menu → Group lifecycle: manage groups
- Groups menu → Group assignment: assign membership
- Queries menu → Account views: inspect users
- Queries menu → Group views: inspect groups
- Provisioning menu → Role bootstrap: run setup
- Account lifecycle → Linux identity state: mutates accounts
- Account editing → Linux identity state: mutates accounts
- Account deletion → Linux identity state: removes accounts
- Group lifecycle → Linux identity state: mutates groups
- Group assignment → Linux identity state: changes ownership and membership
- Role bootstrap → Linux identity state: applies role policy
- Account views → Account database: reads
- Group views → Group database: reads
- Linux identity state → Account database: persists accounts
- Linux identity state → Group database: persists groups