11 / case study
RemoteShell
A remote shell written in C for Linux, built in three phases: a local shell, a remote shell over TCP sockets, and a multitasking server that runs several clients' commands at once under a round-robin scheduler.
- category
- Systems / Operating systems
- with
- Operating systems project
- year
- 2026
- role
- C developer
- tools
- C · Linux · POSIX threads · TCP sockets
- links
- github
why this exists
A shell has to start programs, connect their input and output, and clean up after them without leaking processes or file descriptors. A remote shell has to do the same for many clients over the network at once, without one slow command holding up everyone else.
how it came together
- 01Built the local shell: parsing arguments, running programs with fork and exec, cd and exit built-ins, and pipelines with up to three pipes that close unused pipe ends
- 02Added a TCP client and server, so commands run on the server and their output and errors are sent back to the client
- 03Made the server multitasking: one POSIX thread per client (up to 32), a separate shell worker that keeps each client's working directory, and a round-robin scheduler that gives each command or pipeline 200 ms time slices
- 04Tested input validation and pipeline cleanup with a Python test suite
what came out of it
All three phases work. The threaded server and scheduler from phase 3 are on the phase3-scheduler branch.