0

From what I read, SSH is mainly used for remotely accessing a machine. If I don't want anyone remotely accessing my machine, nor myself included, is it ok to delete these configuration files from my Linux system? Can doing so break the integrity of any secure network or system protocols I have by default?

I'd ultimately remove each file by first getting to the file's directory and using sudo rm

closed as off-topic by multithr3at3d, rox0r, wireghoul, Shane Andrie, Conor Mancone Aug 6 '18 at 20:45

  • This question does not appear to be about Information security within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • you'd be better off just disabling the service and closing port 22 - that way no one could access the machine via ssh – Connor J Jul 31 '18 at 13:53
  • Which configuration file can I do this in? I have gufw denying any incoming or outgoing traffic from port 22 ( I only allow: outgoing TCP traffic from ports 25,53,80,110,443 and UDP traffic from port 53). – cubed Jul 31 '18 at 13:57
  • take a look at Michael Kjörlings answer below, it describes it well – Connor J Jul 31 '18 at 15:11
  • 1
    Deleting a configuration file will result in the system using the default configuration, which may or may not be secure for your purposes. – forest Aug 1 '18 at 5:12
1

If you don't want a SSH server running on your system at all, the better approach is to remove the package that provides the SSH server software. Doing so will remove it cleanly, though it is possible (depending on your distribution) that packages depend on the SSH server packages for some reason. If you just remove its configuration files, odds are good that the system will try to start it anyway, and it will start logging errors (which will clutter up your logs and ultimately might hide something actually interesting).

To do this, use your package manager to remove whichever package provides the SSH server. On Debian and Debian derivatives, you'll likely want to remove openssh-server as seen by searching the list of packages for OpenSSH packages: dpkg -l '*openssh*' by running sudo apt-get remove --purge openssh-server Other systems are likely to be different, so adjust accordingly.

Removing the SSH server shouldn't break anything else as long as the package manager doesn't want to remove additional, unrelated packages; and you can always reinstall it later if you want to.

Not the answer you're looking for? Browse other questions tagged or ask your own question.