Warning:
Enabling SSH service may bring security risks to your system. Please enable it only when necessary and avoid making changes to system configurations.
Run the commands at your own risk.
Follow the steps managed in the following article to access DSM via SSH.
Purpose:
With terminal commands you can control DSM services. Like restarting the Webserver without having to restart the NAS. Or with a hanging process
DSM 6
When running commands sudo before the commands could be necessary depending on the rights of the user.
synoservicecfg –list
synoservicecfg –hard-stop <service>
synoservicecfg -stop <service>
synoservicecfg –hard-start <service>
synoservicecfg -start <service>
synoservice –status
synoservice –restart <service>
synoservicectl –restart <service>
Examples:
Apache webserver:
synoservicecfg stop pkg-apache22
synoservicecfg start pkg-apache22
synoservicecfg reload pkg-apache22
DSM 7
When running commands, sudo before the commands could be necessary depending on the rights of the user.
To list installed packages:
synopkg list –name
To stop a package:
synopkg stop <package name>
To start a package:
synopkg start <package name>
To restart a package (stops a package, then starts it):
synopkg restart <package name>
Examples:
Restart HybridShare:
synopkg restart HybridShare
Stop USBCopy:
synopkg stop USBCopy