[Ubuntu] 명령어 히스토리 로그 남기는 방법
히스토리를 syslog 로그로 남기는 방법입니다. 1. /etc/profile에 아래 내용을 추가합니다. vi /etc/profile function history_to_syslog { declare command remoteaddr="`who am i`" command=$(fc -ln -0) if [ "$command" != "$old_command" ]; then logger -p local1.notice -t bash -i ? "$USER : $remoteaddr" : "$command" fi old_command=$command } trap history_to_syslog DEBUG 2. /etc/syslog.conf 하단에 내용 추가 vi /etc/syslog.conf local1.notice ..