Disable sshd start on boot in ubuntu
On my local computer, i have installed openssh-server, but i don’t want it always enabled.
To disable openssh-server from auto start on boot, run
1 |
systemctl disable ssh |
Example
1 2 3 4 5 6 |
root@lab:~# systemctl disable ssh Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install disable ssh Removed /etc/systemd/system/sshd.service. Removed /etc/systemd/system/multi-user.target.wants/ssh.service. root@lab:~# |
If you want to start ssh server on boot, run systelctl enable ssh
1 2 3 4 5 6 |
root@lab:~# systemctl enable ssh Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable ssh Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service. Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service. root@lab:~# |
See Ubuntu