How to get shell on Synology NAS

(last update ) · 3 minutes

hero-banner

Explaination

Before anything else, I do not recommend using this on a daily basis, but in case of emergency, it can be the only way to interact with the internal network.

In times of emergency, having access to an SSH shell or a curl capable to reach internal APIs, none exposed to the outside network, can be crucial. Synology does not offer an easy way to do this unless you have previously exposed the SSH port of your Synology NAS to the outside world, which I don’t recommend. Luckily, by leveraging the container manager, we can quickly obtain access.

Requirements

1. Deploy with full privileges

Image: bash:latest

During deployment, ensure you grant full privileges and host access to the container. This step is essential for unrestricted interaction within the NAS environment.

2. Accessing the Shell

Once deployed, accessing the shell is straightforward. Simply navigate to the container’s settings and click on “see logs.” From there, you’ll gain access to a TTY, allowing seamless interaction with the container.

3. Installing tools

For your information, the package manager is APK. So, if you need to use an SSH client, for example, you will need to execute:

apk add openssh

Similarly, for nmap:

apk add nmap

And so on…