Credential Playground

GitHub

Overview

This is a mock UNIX shell with a user management system written in rust. I built it as an educational project to better understand password and user management. The shell features extendable permission based commands, secure user operations, and hash + salt secret storage.

Details

Auth Library

The authentication library provides:

Interactive Shell

The REPL shell is managed by an environment struct that holds user information, the command registry, and the credentials backend. Commands are extensible by design, with a standard structure for permissions, calling convention, and help messages. Commands have permission levels that enforce access control for logged out, user, and root.

Supported Commands

CommandArgumentsMin PrivilegeDescription
usersNonelist all accounts
helpNonelist all commands
whoamiNoneprint current username
clearNoneclear screen
exitNoneexit the shell
login<account>Nonelogin to an account
logoutUserlogout of an account
switchuser<account>Userlogout and login to another account
chname[account] <name>Userchange account name, if root change a different accounts
chpass[account]Userchange password, if root can change another account
mkuser<account>Rootcreate an account
rmuser<account>Rootdelete an account
resetRootdelete all accounts, logout