Trace a command on a production Linux server to the person who ran it
When something breaks on a Linux server, the usual logs rarely say who typed what. Bash history belongs to each user, who can clear it, and auth.log records logins without any of the commands that followed. shellz captures each login on the box as a playable recording with text you can search. You search for the command, open the session that ran it, and watch what happened.
Choose shellz if
- Several engineers and CI jobs share an account like
deployorroot, and you can't tell their sessions apart today. - You need to see what a command printed as well as who ran it.
- You also need
ssh host cmdruns and file uploads in the record. Neither starts an interactive shell, so bash history never sees them. - Postmortems need evidence you can attach, with a way to show nobody edited it afterwards.
Rely on system logs and auditd if
- You need every process on the server, including cron jobs and services that never log in. The Linux audit system covers that (shellz vs auditd).
- Your incidents happen in Kubernetes, databases or Windows. shellz records Linux terminals only.
- Your responders work entirely in a SIEM, and there's no shellz connector for one yet.
- Evidence may not leave your own data center. shellz runs only as a hosted service.
At a glance
| Capability | shellz recording | Bash history | auth.log and `last` |
|---|---|---|---|
| Who logged in, and from which IP | Yes, on every session | No | Yes |
| Commands typed in a shell | Yes | Partial: saved to disk when the shell exits | No |
| What those commands printed | Yes, playable and searchable | No | No |
| `ssh host cmd` and SFTP transfers | Yes, recorded separately | No: history is off in non-interactive shells | Partial: the connection is logged, the command isn't |
| Can the user erase it? | No: uploads are write-once | Yes: history -c, or unset HISTFILE | Root can edit files on the server |
| Shows if part is missing | Yes: sessions are marked verified, gap or tampered | No | No |
Bash history can be wiped by the person you're asking about
Bash keeps each user's commands in their own ~/.bash_history. It writes them there when the shell exits, so a session that's still open hasn't saved anything yet.
The user owns that file. history -c clears the list, history -d removes single entries, and unsetting HISTFILE means nothing is written at exit. If HISTCONTROL includes ignorespace, any command typed with a leading space is never saved.
Two shells open as the same user can also overwrite each other's history, unless the histappend option is on.
History is off in non-interactive shells. A command sent as ssh web-03 'rm -rf /srv/cache/*' runs and leaves no trace in anyone's history file.
auth.log and last stop at the login
sshd writes the start, authentication and end of each connection to the system log. Where it lands depends on the distribution: /var/log/auth.log on some, the systemd journal on others. last reads the wtmp file and lists who connected, from where, and for how long.
That's enough to learn alice was on db-02 from 01:58 to 02:14. It says nothing about what she ran. When four engineers and a CI job all use the deploy account, it says even less.
Search for the command, then open the session that ran it
Every way into the box is covered: interactive SSH, single remote commands, SFTP uploads, su - and console logins. Each session is stored twice, as a full replay and as plain text, and the text is what you search later.
- Search for the command or the path it touched. Narrow by user, source IP, server, or container name and image.
- Open the session and replay it at whatever speed suits you. The transcript sits next to the player, so you can copy an error message exactly.
- Follow the trail. Container shells carry a pointer to the SSH session that spawned them, so you can walk from
docker execback to whoever logged in. - Export the session as a
.castreplay or a.txttranscript and attach it to the postmortem.
Example: the cache directory that emptied itself at 02:06
This timeline is invented for illustration. At 02:07 the API on web-03 starts returning errors because its cache directory is empty. The deploy user's bash history ends the previous afternoon.
A search for /srv/cache returns one session. It's a remote command from a CI runner's IP at 02:06, logged in as deploy. The replay shows a cleanup script printing the directory it was about to clear, then clearing it. The fix goes into the script, and the exported transcript goes into the incident doc.
Every session shows whether its recording is complete
Each session carries an integrity badge with one of three states: verified, gap or tampered. Recordings upload in pieces that the server signs and chains together, so a dropped or modified piece gets flagged on the session.
Nobody can alter or remove a recording after upload. Root changes to the recorder's settings get rolled back and flagged. If a server goes silent, an alert fires within a minute.
Root on a box can always fiddle with local software, and shellz makes sure the fiddling is caught and flagged. Viewing is audited too. Each playback is logged, so you can show who watched which recording during the investigation.
Background jobs and services leave no recording
shellz records login sessions. A cron job, a systemd service or an agent running in the background never logs in, so nothing is recorded. auditd, the kernel's log of every program executed, covers that gap alongside shellz.
Input at hidden prompts, a sudo password for example, never reaches the recording. Output does, so handle recordings as sensitive data. They're encrypted before they leave the machine, and under Perfect Secrecy the decryption keys exist only on your teammates' passkeys.
Install it before the incident you'll need it for
Recordings exist only for sessions that happened after shellz was installed. Getting coverage means pasting one command on each machine. The free tier gives you 10 active devices and the most recent 50 recordings. Commercial charges $10 monthly per person on your team and $1 per GB, and keeps recordings as long as you want (plans).
Questions
How can I tell which user ran a command on a Linux server?
Check last and the system log for who was logged in at the time, then each user's ~/.bash_history. Those only help if the user didn't clear history and the command came from an interactive shell. A session recorder like shellz lets you search for the command itself and replay the session that ran it.
Can a user delete their bash history?
Yes. history -c clears it, history -d deletes single entries, and unsetting HISTFILE stops bash saving it at exit. The user owns ~/.bash_history, so they can also edit or delete the file.
Why isn't a command run with ssh host cmd in bash history?
Bash only keeps history in interactive shells. A command passed on the ssh command line runs in a non-interactive shell, so it's never saved. shellz records it as its own session, with the output.
Does auth.log show the commands a user ran?
No. sshd logs the start, authentication and end of each connection. What happened inside the session isn't in auth.log or the journal.
Can someone with root delete a shellz recording?
Not once it's uploaded. Recordings are stored write-once, and any break in the chain shows up as a gap or tampered badge.
Related comparisons
Sources
Competitor details come from public documentation and pricing pages, last checked on November 4, 2026. Products change; if something here is out of date, tell us at hello@shellz.dev and we will correct it.