After installing openssh-server, the server start every time I boot. If I want it to be manual what do I need to do?
In version 0.6.7+ of upstart I would add a "manual" stanza to the job file.
10.04 has upstart 0.6.5-8. What is the preferred way to disable ssh from starting automatically in this case?
Rename /etc/init/ssh.conf to /etc/init/ssh.conf.disabled.
This should be enough,:
In your /etc/init/ssh.conf, comment out the start on line:
For system having
systemd
the proper way to do it isthen
note to the reader:
for me (ubuntu 14.xx) only Bryan Agee's answer worked: /etc/init/ssh.conf: comment out the "start on filesystem or runlevel..." line
why won't the others do?
will result in completly deactivating the service. It is then not startable through "service ssh start" anymore.
does simply not work (perhaps uses different autostart routine)
simply doesnt work
also completly disables the system
nice software, but it doesn't show ssh, so nothing to do here
person questioning: why are the above answeres even here? is the start system so complicated or does nobody tries his solutions? oO
Start
bum
with administrative privileges, disable openssh-server, confirm it, done.For versions with ssh started by upstart, run
touch /etc/ssh/sshd_not_to_be_run
. The upstart init script checks for this file and, if existent, does not start sshd.The manual method provided
/etc/init/ssh.config
.override method does not work for me using Ubuntu 14.04.03.sshd
still starts automatically.The
/etc/ssh/sshd_not_to_be_run
method prevents manualsshd
start.I had to use Brian Agee's method of removing the "start on" on line of
/etc/init/ssh.conf
. Then to manually startsshd
:I had the same question and here's what I did about it. It's a bit of a hack, perhaps, but it works well enough, and you don't need to compromise the program in any way. Put the following in your crontab:
This tells
cron
to stopssh
every time you turn on your computer. Usingssh
to connect to another computer isn't affected, as this only turns off the server service. And if you want to re-enable it for a short while, all you have to do is:Just remember to turn it back off when you're done!