Skip to contentSkip to conversation

recommended way to "/bin/sh" -> "/sbin/nologin" various accounts in new image?

DISCUSSION Robert P. J. Day 1 participant 1 message Apr 13, 2020

lore
Share & tools
lore
#0 lore raw

colleague just pointed out that, in a new core-image-minimal, the
base-passwd recipe loads up /etc/passwd (based on initial passwd.master file) with various accounts that really don't merit a login shell of /bin/sh:
...
daemon:*:1:1:daemon:/usr/sbin:/bin/sh bin:*:2:2:bin:/bin:/bin/sh
sys:*:3:3:sys:/dev:/bin/sh sync:*:4:65534:sync:/bin:/bin/sync games:*:5:60:games:/usr/games:/bin/sh man:*:6:12:man:/var/cache/man:/bin/sh lp:*:7:7:lp:/var/spool/lpd:/bin/sh mail:*:8:8:mail:/var/mail:/bin/sh news:*:9:9:news:/var/spool/news:/bin/sh
...

it is, of course, trivial to add a couple patches to
base-passwd.bbappend to reduce a lot of those to using /sbin/nologin rather than /bin/sh, but is there a simpler way? is there a variable which you can set to, say, the passwd accounts to be weakened this way? or do people just patch the passwd.master file? or is there yet another alternative?

rday