Disable/enable ssh via CLI

Is it possible to use some shell commands to enable/disable SSH service instead graphic Setting?

Disable might be possible if anyone knows but enable would be impossible if there is no way to open a shell.

What you meant “if anyone knows”?

I mean, I don’t know how to do it. But, disabling is theoretically possible but enabling ssh using command line shell after it has been disabled is impossible as there is no way to access the shell.

I agree. Thanks

systemctl stop sshd

The above will disable SSH until the box is rebooted.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.