If you can use tmux or screen, they have the ability to save the scrollback buffer to a file.
- Write all tmux scrollback to a file
- Copying GNU screen scrollback buffer to file (extended hardcopy)?
 Unlike screendump, which is Linux-only, tmux and screen are available for BSD-based OSes too (e.g. macOS, FreeBSD) and won't require special permissions.