Category Archives: Howto Tutorials (EN)

Knowledge Network for Tutorials, Howto’s, Workaround, DevOps Code for Professionals.

How to Install Midnight Commander on Synology NAS

Install Midnight Commander in Synology DSM Terminal Shell

This post shows how to deploy Midnight Commander on a Synology NAS, the file manager for the file system in the Synology Shell via SSH. Midnight Commander, short mc is one of the most well-known console programs on Linux. Fortunately, you can easily add additional software repositories to the Synology NAS to install additional tools.

The Midnight Commander is not provided or managed by Synology itself, but can be retrieved from the SynoCommunity repository. The SynoCommunity offers free packages for Synology NAS devices.

How to add the SynoCommunity repository

Synology DSM Main Menu

From DSM you open the main menu with the icon at the top left, there you will find the Package Center.

By clicking on the icon Package Center to open this, then click the Settings button.

Synology Icon Package Center
Synology Package Center

In the now opened General window under Trust Level, enable the Synology Inc. and trusted publishers option.

Synology Trust Level

Then go to the Package Sources section.

Synology Package Sources

Click the Add button and insert the package source, enter SynoCommunity as the name, and insert the URL https://packages.synocommunity.com/ at location and click OK.

Synology Add Package Source

Packages can now be installed. The SynoCli File Tools package provides the following command-line utilities: less, tree, ncdu, jdupes, rhash, mc (midnight-commander), nano, file, detox, rmlint, rnm, pcre2, zstd. Nano used to be a separate package, but is now only available through the SynoCli File Tools package.

SynoCli File Tools

Now you can connect with a terminal like PuTTY to diskstation and run mc in the shell.

NAS7:/$ sudo mc

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:

Midnight Commander

Use sudo to run mc, after the admin password is entering the Midnight Commander is opened.

Midnight Commander on the Synology Shell

In the menu bar below, the functions of mc can be used via the F-keys or also with the mouse, such as Edit or Copy, with the cursor keys or the mouse you navigate in the window, press tab to switch to the other window, press F10 to leave Midnight Commander.

  Remember, changes to system files require knowledge of the function and its effects.

Enable Synology DSM SSH service

In order for the terminal to be accessible via SSH, the SSH service must be activated in the DSM Control Panel, under Terminal & SNMP, in order to make the Icon Terminal & SNMP visible, Advanced Mode is selected at the top right.

Synology Control Panel

In the Terminal window, enable the SSH service option.

Synology Enable SSH service

Next post on the same topic might be helpful, see in How to Install Nano on Synology NAS

How to Install Nano Editor on Synology NAS

Apply Nano Editor on Synology DSM Terminal Shell

This article shows how to deploy Nano editor on a Synology NAS for editing in the Synology Shell via SSH. For users who are not empowered by the VIM Editor, there is a remedy by installing the often preferred editor Nano, since Nano is easier to use than VIM. Fortunately, you can easily add additional software repositories to the Synology NAS to install Nano and many other tools.

Nano is not provided or managed by Synology itself, but can be get from the SynoCommunity repository. The SynoCommunity offers free packages for Synology NAS devices.

How to add the SynoCommunity repository

Synology Main Menu

From DSM you open the main menu with the icon at the top left, there you will find the Package Center.

By clicking on the icon Package Center to open this, then click the Settings button.

Synology Package Center
Nano Editor in Synology, Synology DSM Package Center

In the now open General under Trust Level, enable the Synology Inc. and trusted publishers option.

Nano Editor in Synology, Synology Settings Trust Level

Then go to the Package Sources section.

Synology DSM Package Sources

Click the Add button and add the package source. Enter SynoCommunity as the name, and insert the URL https://packages.synocommunity.com/ at location and click OK.

Synology Add Package Sources

Install Nano Editor on Synology

Packages can now be installed. The SynoCli File Tools package provides the following command-line utilities: less, tree, ncdu, jdupes, rhash, mc (midnight-commander), nano, file, detox, rmlint, rnm, pcre2, zstd. Nano used to be a separate package, but is now only available through the SynoCli File Tools package.

Install Synocli File Tools and Nano Edtor on Synology

Now you can connect to diskstation with use a terminal like PuTTY and editing in the shell using nano, for example the SSH server configuration file.

diskstation:/$ sudo nano /etc/ssh/sshd_config
 
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
 
    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
 
Password:

With the admin password what sudo requires, the file sshd_config is loaded into the editor here.

Use nano in Synology DSM shell console

After editing, press the keys Ctrl + X, nano asks if the change should be saved, which can be confirmed with Y if necessary, otherwise N can be selected.

  Remember, changes to system files require knowledge of the function and its effects.

Enable Synology DSM SSH service

In order for the terminal to be accessible via SSH, the SSH service must be activated in the DSM Control Panel, under Terminal & SNMP. To make shure the Icon Terminal & SNMP is visible, Advanced Mode is selected at the top right.

Synology Control Panel

In the Terminal window, enable the SSH service option.

Synology Enable SSH service

Next post on the same topic might be helpful, see in How to Install Midnight Commander on Synology NAS