Guest User

Untitled

a guest
Dec 6th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. # --------------------------------------------------------
  2. #
  3. # View information for use 'logcheck' using passwd and group files
  4. #
  5. # --------------------------------------------------------
  6.  
  7. # cat /etc/passwd | grep logcheck
  8. logcheck:x:102:104:logcheck system account,,,:/var/lib/logcheck:/bin/false
  9.  
  10. # cat /etc/group | grep logcheck
  11. adm:x:4:logcheck
  12. mail:x:8:logcheck
  13. logcheck:x:104:
  14.  
  15. # --------------------------------------------------------
  16. #
  17. # How I want 'logcheck' user to be configured via BCFG2.
  18. # I tried to set this so that it matches the existing user.
  19. #
  20. # --------------------------------------------------------
  21.  
  22. # cat /var/lib/bcfg2/Properties/accounts.xml
  23. <Properties>
  24.  
  25. <!-- Make sure logcheck is a member of the mail group. By default
  26. "he" isn't. On our system logcheck needs to be, or "he" won't be
  27. able to send mail via sSMTP due to permissions on the ssmtp
  28. config file related to the presence of a non-critical clear-text
  29. password.
  30. -->
  31. <UnixUser name='logcheck'
  32. uid='102'
  33. group='logcheck'
  34. gid='104'
  35. gecos='logcheck system account'
  36. home='/var/lib/logcheck'
  37. shell='/bin/false'
  38. extra_groups='adm mail' />
  39.  
  40. </Properties>
  41.  
  42. # --------------------------------------------------------
  43. #
  44. # Running bcfg2 in dry run mode gives no output or indication that
  45. # the user 'logcheck' needs any changing
  46. #
  47. # --------------------------------------------------------
  48.  
  49. # bcfg2 -vn
  50. Running probe accounts
  51. Probe accounts has result:
  52. U:root:0:root:root@tsw-policy:/root:/bin/bash:
  53. U:daemon:1:daemon:daemon:/usr/sbin:/bin/sh:
  54. U:bin:2:bin:bin:/bin:/bin/sh:
  55. U:sys:3:sys:sys:/dev:/bin/sh:
  56. U:sync:4:nogroup:sync:/bin:/bin/sync:
  57. U:games:5:games:games:/usr/games:/bin/sh:
  58. U:man:6:man:man:/var/cache/man:/bin/sh:
  59. U:lp:7:lp:lp:/var/spool/lpd:/bin/sh:
  60. U:mail:8:mail:mail:/var/mail:/bin/sh:
  61. U:news:9:news:news:/var/spool/news:/bin/sh:
  62. U:uucp:10:uucp:uucp:/var/spool/uucp:/bin/sh:
  63. U:proxy:13:proxy:proxy:/bin:/bin/sh:
  64. U:www-data:33:www-data:www-data:/var/www:/bin/sh:
  65. U:backup:34:backup:backup:/var/backups:/bin/sh:
  66. U:list:38:list:Mailing List Manager:/var/list:/bin/sh:
  67. U:irc:39:irc:ircd:/var/run/ircd:/bin/sh:
  68. U:gnats:41:gnats:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh:
  69. U:nobody:65534:nogroup:nobody:/nonexistent:/bin/sh:
  70. U:libuuid:100:libuuid::/var/lib/libuuid:/bin/sh:
  71. U:sshd:101:nogroup::/var/run/sshd:/usr/sbin/nologin:
  72. U:logcheck:102:logcheck:logcheck system account,,,:/var/lib/logcheck:/bin/false:
  73. adm mail
  74. G:root:0
  75. G:daemon:1
  76. G:bin:2
  77. G:sys:3
  78. G:adm:4
  79. G:tty:5
  80. G:disk:6
  81. G:lp:7
  82. G:mail:8
  83. G:news:9
  84. G:uucp:10
  85. G:man:12
  86. G:proxy:13
  87. G:kmem:15
  88. G:dialout:20
  89. G:fax:21
  90. G:voice:22
  91. G:cdrom:24
  92. G:floppy:25
  93. G:tape:26
  94. G:sudo:27
  95. G:audio:29
  96. G:dip:30
  97. G:www-data:33
  98. G:backup:34
  99. G:operator:37
  100. G:list:38
  101. G:irc:39
  102. G:src:40
  103. G:gnats:41
  104. G:shadow:42
  105. G:utmp:43
  106. G:video:44
  107. G:sasl:45
  108. G:plugdev:46
  109. G:staff:50
  110. G:games:60
  111. G:users:100
  112. G:nogroup:65534
  113. G:libuuid:101
  114. G:crontab:102
  115. G:ssh:103
  116. G:logcheck:104
  117. Running probe groups
  118. Probe groups has result:
  119. group:amd64
  120. Loaded tool drivers:
  121. APT Action DebInit POSIX
  122.  
  123. Phase: initial
  124. Correct entries: 253
  125. Incorrect entries: 0
  126. Total managed entries: 253
  127. Unmanaged entries: 5
  128.  
  129.  
  130. Phase: final
  131. Correct entries: 253
  132. Incorrect entries: 0
  133. Total managed entries: 253
  134. Unmanaged entries: 5
  135.  
  136. # --------------------------------------------------------
  137. #
  138. # Running bcfg not in dry-run mode suddenly wants to make a change
  139. # to the 'logcheck' user, but why? If I am correctly interpreting the
  140. # usermod command it wants to run, this will have no effect on the system.
  141. #
  142. # Doesn't the bcfg2-accounts plugin query the system and check the existing
  143. # user accounts before issuing the command to usermod?
  144. #
  145. # --------------------------------------------------------
  146.  
  147. # bcfg2 -I
  148. Run Action usermod logcheck, /usr/sbin/usermod -m -u '102' -g 'logcheck' -G 'adm,mail' -d '/var/lib/logcheck' -s '/bin/false' -c 'logcheck system account' 'logcheck': (y/N): N
Add Comment
Please, Sign In to add comment