Software⏱️ 4 min read📅 2026-06-11

How to Fix: Error enabling sshd on Ubuntu 16.04

Error enabling sshd on Ubuntu 16.04: Too many levels of symbolic links

Quick Answer: Check if the /etc/ssh directory has been moved or renamed, and try running the command with the -v flag to see more detailed error messages.

Error enabling sshd on Ubuntu 16.04 is an issue affecting users who have installedUbuntu Server 16.04 on a virtual machine and are attempting to enable the SSH server. This error occurs when the user attempts to use the `systemctl` command to enable the `sshd` service, but the operation fails due to an excessive number of symbolic links.

This error can be frustrating for users as it prevents them from accessing their server remotely using SSH. Fortunately, this issue is resolvable by following a few simple steps to resolve the problem.

⚠️ Common Causes

  • The primary reason for this error is that the `systemctl` command is trying to enable the `sshd` service on a system where there are too many symbolic links in the path. This can occur when the system has been modified to use symbolic links extensively, or if there have been previous attempts to install and uninstall packages without properly cleaning up the file system.
  • An alternative reason for this error is that the `sshd` service may not be installed or enabled correctly on the system. In some cases, the package manager may not have installed the service correctly, or it may be disabled due to a configuration issue.

🛠️ Step-by-Step Verified Fixes

Enabling sshd using the systemd command

  1. Step 1: To resolve this error, use the following command to enable the `sshd` service: `sudo systemctl enable sshd`. This command will create a symbolic link in the system's configuration directory that points to the `sshd` service.
  2. Step 2: Next, restart the `systemd` service manager using the command `sudo systemctl daemon-reload`. This step is necessary to ensure that the symbolic links are properly updated and the `sshd` service is enabled correctly.
  3. Step 3: Finally, verify that the `sshd` service is enabled by running the command `sudo systemctl status sshd`. If everything is set up correctly, you should see a 'active (running)' status for the service.

Enabling sshd using the traditional init script

  1. Step 1: Alternatively, if the above method does not work, you can try enabling the `sshd` service using the traditional init script. To do this, edit the `/etc/init.d/ssh` file and add the following lines at the end of the file: `ln -s /usr/lib/systemd/system/sshd.service /etc/rc3.d/`. This will create a symbolic link to the `sshd` service in the system's rc directory.
  2. Step 2: Next, restart the init script manager using the command `sudo /etc/init.d/halt`. This step is necessary to ensure that the symbolic links are properly updated and the `sshd` service is enabled correctly.

🎯 Final Words

By following one of these methods, you should be able to resolve the error enabling sshd on Ubuntu 16.04. Remember to verify that the `sshd` service is enabled correctly after attempting either method.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions