QNAP Command Line

The CLI on a QNAP NAS provides access to many capabilities that are not fully exposed on the QTS desktop. The CLI is accessed via an “ssh” session. In this video we learn how to enable and use both “ssh” and “sftp” from the Network & File Services Control Panel.

The Address for the “NEW” QNAP Club App repository is: https://www.myqnap.org/repo.xml

We installed one of the QNAP Club offered Entware apps which is an Optware package manager for embedded OS systems like the QNAP NAS.

We logged into our QNAP NAS from the command line with ssh (your address will differ):

ssh admin@172.16.1.57

We used the following command to update the package repository, list packages and install three packages:

opkg update
opkg list
opkg  install whereis
opkg  install nano
opkg  install net-tools

To see the default file map for your QNAP:

getcfg SHARE\_DEF defVolMP -f /etc/config/def\_share.info

We can examine the PATH with:

echo $PATH

If you want to update your path you can make changes and then export the new path:

export PATH=/opt/bin:/opt/sbin:/share/CACHEDEV1_DATA/.qpkg/container-station/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin

The /share folder with your default volume map defines where your file station data is stored. In my case:

cd /share/CACHEDEV1_DATA

You can manage containers with “lxc”, “docker”, and docker-compose from the command line and you can do far more than container station. Watch my tutorials on LXD containers and VLANs to learn how to super charge container station by working from the CLI.

1 Like