linux

    技术2026-02-05  2

    ID = linux_ask_02

    Status: closed

    Question

    How to manage auto startup service? Take ssh service as example, this is enabled by default. I want to disable it.

    Answer

    Learn from [1], the way is simple. To disable the SSH service to start during system boot run: $ sudo systemctl disable ssh

    To enable it again type: $ sudo systemctl enable ssh

    [200628] Tried it, and worked well. $ sudo service ssh stop $ sudo systemctl disable ssh

    Then restart the computer, and check ssh status:

    $ sudo service ssh status ● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: > Active: inactive (dead) Docs: man:sshd(8) man:sshd_config(5)

    Reference

    [1] How to Enable SSH on Ubuntu 18.04

    Processed: 0.027, SQL: 9