[yocto] Disabling sshd is harder than it should be

ChenQi Qi.Chen at windriver.com
Mon Apr 29 00:33:03 PDT 2019


On 04/26/2019 09:26 PM, Richard Weinberger wrote:
> My thud based system installs openssh-sshd but I want to have sshd
> disabled by default.
> So I checked the docs how to disabled a systemd service by default and
> found SYSTEMD_AUTO_ENABLE, perfect.
>
> After I put that into my bbappend file I figured that sshd is still
> enabled by default.
> With one difference, it was no longer present as sshd.socket, but as
> sshd.service.
> This seemed odd and after another hour I realized that now sshd is
> stared as good old sysvinist script. Hmm.
>
> To finally disable sshd by default I had to disable it via systemd
> _and_ sysvinit.
> Is this really the expected way? :-(
>
> For reference, this is my bbappend file which works:
> SYSTEMD_AUTO_ENABLE = "disable"
> INITSCRIPT_PARAMS_${PN}-sshd = "remove"
>

When selecting systemd as the init manager, the following line is 
recommended.
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
Then you should only need: SYSTEMD_AUTO_ENABLE = "disable"

Best Regards,
Chen Qi


More information about the yocto mailing list