> For the complete documentation index, see [llms.txt](https://knowledge.tracelog.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.tracelog.in/linux-and-core/linux/record-ssh-session-for-reporting.md).

# Record SSH session for reporting

The issue is whenever logging ssh to a linux vm for investigating or doing something, after done, I want to report on **what I did** for writing into ticket. In the past, I use the `history`command and scroll back to the beginning. It's waste of time & effort, sometime cannot trace because of lacking scroll or closing terminal tab by human mistake, or wanna trace in the next few days.

So that I need a good solution for this to work effectively

```bash
touch /ssh.log
ssh <target> -v | tee -ia /ssh.log
```

For seeing output for tracking & reporting, use `tail`

```bash
tail -f -n +1 /ssh.log
```
