Probably your best option is to use screen, which is generally appropriately setuid (and installed on non-graphical machines), and tell screen to log all output to a file.<p>You may need to use C-a L to ask screen to register the current window in utmp.