I installed openssh-server,it will start ssh server on boot automatic.But I don't want that.How to forbid ssh server to autostart on boot?
Asked
Active
Viewed 1,295 times
1 Answers
1
You can disable sshd from starting at boot with command
sudo systemctl disable sshd.service
Edit 1
Rename /etc/init/sshd.conf to /etc/init/sshd.conf.disabled.
sudo mv /etc/init/sshd.conf /etc/init/sshd.conf.disabled
Edit 2
Or you can try command
sudo update-rc.d sshd disable
2707974
- 10,363
- 6
- 31
- 44
-
I tried it , but got an error: `systemctl: command not found`. – hxysayhi Jun 28 '17 at 09:31
-
1@yixiao What ubuntu version are you using? – Ziazis Jun 28 '17 at 09:34
-
You have my edit 1. Try with that – 2707974 Jun 28 '17 at 09:39
-
@Ziazis ubuntu14.04, while `systemctl` are used from ubuntu15 – hxysayhi Jun 28 '17 at 10:31
-
@2707974 thanks, but there is no file name /etc/init/sshd.conf. I will try /etc/init/ssh.conf.and I just don't want it to run automatic,but your suggestion make it be not startable. Thanks anyway. – hxysayhi Jun 28 '17 at 10:55
-
How do you want to use ssh, what are you going to do with it? – jeroen Jun 28 '17 at 15:41