Product SiteDocumentation Site

5.16.4. Responsible Identification with sudo

One of the disadvantages of /var/log/yum.log log file is that it does not identify the person responsible for the activity yum. Combining the use of sudo with yum history command it provides a more detailed information of the yum transaction. Below is sample output.
User gomix authorized via sudo to use the yum command.
[gomix@fricky ~]$ id
uid=502(gomix) gid=502(gomix) grupos=497(pulse-rt),502(gomix)
[gomix@fricky ~]$ sudo yum -y install iftop
...
Output and verification with yum history:
$ yum history | head
...
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   627 | Guillermo <gomix>      | 2010-12-24 12:39 | Install        |    4   
   626 | System <unset>         | 2010-12-24 11:01 | Update         |   18   
   625 | Guillermo <gomix>      | 2010-12-24 10:58 | Downgrade      |   18   
   624 | System <unset>         | 2010-12-24 10:52 | Update         |   19   
   623 | Guillermo <gomix>      | 2010-12-23 18:09 | Erase          |    1   
   622 | Guillermo <gomix>      | 2010-12-23 16:29 | Downgrade      |    2
Details of the last transaction.
$ yum history info 627
...
Transaction ID : 627
Begin time     : Fri Dec 24 12:39:33 2010
Begin rpmdb    : 2543:79c064669327b059106d868335f372e1c79bade3
End time       :            12:40:04 2010 (31 seconds)
End rpmdb      : 2547:5c1b298973c681d16f6a1890092338698844a497
User           : Guillermo <gomix>
Return-Code    : Success
Transaction performed with:
    Installed     rpm-4.8.1-5.fc14.x86_64
    Installed     yum-3.2.28-5.fc14.noarch
    Installed     yum-plugin-aliases-1.1.28-1.fc14.noarch
    Installed     yum-presto-0.6.2-2.fc14.noarch
Packages Altered:
    Dep-Install Xaw3d-1.5E-19.fc14.x86_64
    Dep-Install transfig-1:3.2.5d-1.fc14.x86_64
    Install     xfig-3.2.5-25.b.fc14.x86_64
    Dep-Install xfig-common-3.2.5-25.b.fc14.x86_64
history info