# How to record all terminal sessions' activities into a file?



## koray (Dec 12, 2018)

Hi All,

FreeBSD 9.1-RELEASE

We have ttyrec files available which records all user sessions and those can be viewed with ttyplay. 
We need to have similar kind of terminal session recording in .txt or .log format to work on it daily for searching, monitoring etc. 
It should run automatically for any terminal session as ttyrec does. 
The "script" command doesnt do that as it is specific to the user logged in and it is activated by the user. 

Is there any way to do that? 
Additionaly I dont think the ttyrec files can be converted into .txt or .log format. If it was available, that would work too. 

Thanks,


----------



## ShelLuser (Dec 12, 2018)

FreeBSD 9.1 has been EOL for _years_ and is no longer supported. So to start you should really upgrade to a supported version, either 11.2 or 12.0 (though I wouldn't recommend 12 for production just yet because it just got out).


----------



## SirDice (Dec 12, 2018)

The "Howto" section is not for asking how to do things. Thread moved.



koray said:


> FreeBSD 9.1-RELEASE


FreeBSD 9.1 has been End-of-Life since December 2014 and is not supported any more.

Topics about unsupported FreeBSD versions
https://www.freebsd.org/security/unsupported.html


----------



## T-Daemon (Dec 12, 2018)

Since the topic is not direct related to supported or unsupported versions of FreeBSD, for those who are interested (like I am) or in need:

Automatically Record/Capture All Users Terminal Sessions Activity In Linux


> .....
> It can be done using script command. Just add the script on /etc/profile file. It will automatically start recording user terminal sessions activity whenever user logged in.
> .....


----------



## SirDice (Dec 12, 2018)

> Just add the script on /etc/profile file. It will automatically start recording user terminal sessions activity whenever user logged in.


This only works if the user has a Bourne shell, /etc/profile isn't used with the C Shells.


----------



## T-Daemon (Dec 13, 2018)

SirDice said:


> This only works if the user has a Bourne shell, /etc/profile isn't used with the C Shells.


I didn’t realise. Thanks for clarification. Nevertheless it’s a starting point for the OP and eventually others how to implement such a function. Adapting the syntax to the C Shells [edit] and putting it in the appropiate system wide configuration file [/edit] shouldn't be a problem, not that I can do it without instructing myself into the subject.


----------

