-1

Ubuntu 20.04.

I have installed the openssh-server to test with ssh, but since then, whenever I boot up the system, the server starts running at port 22, which I feel is a security risk when I am connected with WiFi (and maybe it even hogs a lot of RAM).

So my questions are

  • How to control from the terminal whether the service starts at boot. I understand it has something to do with systemd, but somewhat of a noob to know it. Basically what commands add or remove it from starting at booting?
  • When the machine is powered on, what commands can start, stop, restart the service? I can kill the process by sending a signal, but wonder whether that is really a graceful exit.
Della
  • 505

1 Answers1

0

You can disable (so it doesn't start at boot) the service with

sudo systemctl disable ssh.service

then start it when needed with

sudo systemctl start ssh.service

To change the port edit

/etc/ssh/sshd_config

The file has a commented port line

mawa
  • 141