Openembedded: Disable sshd.socket in Linux Image

Hello,

I am trying to close all the ports on the default imx6 Linux 2.7b4 Image. By default sshd.socket service is enabled which opens port 22.

How can I disable sshd.socket in openembedded build ?

Hi @Darion!

If you’re not using SSH at all, you could remove the openssh package from your build.
Alternatively, you could follow these instructions which deal with the same issue.

Best regards,

Gustavo.

Hi @gustavo.tx

I plan on using ssh but just not enabled all the time.

How can I disable sshd.socket ?

HI @Darion

You can temporarily disable and enable sshd socket like this:

systemctl stop sshd.socket

systemctl start sshd.socket

Best regards,
Jaski

Hey @jaski.tx

I have running custom services on Linux. I am having them installed and disabled in the Linux Image using the following command:

SYSTEMD_AUTO_ENABLE_servicename = “disable”

Is there anything like this for sshd.socket service which can be used to disable in the Linux Image ? I want the service installed though.

Thanks

Hi

You can disable a service in Systemd like this:

systemctl disable service-name

Best regards,
Jaski