如何在命令行上使用命令行?

问题描述 投票:12回答:4

出于某种原因,我现在正在研究一个synology系统。但是我看不到任何命令行工具,比如linux上的终端或者在synology上的窗口上的cmd。

是否有任何工具可以在synologi上使用命令行?如果是,请建议我一些。

谢谢。

synology
4个回答
15
投票

您可以使用自己喜欢的telnet(不推荐)或ssh(推荐)应用程序连接到Synology框并将其用作终端。

  1. 从网络服务启用命令行界面(CLI)
  2. 定义协议和用户,并确保用户已设置密码
  3. 访问CLI

如果您需要更详细的说明,请阅读https://www.synology.com/en-global/knowledgebase/DSM/help/DSM/AdminCenter/system_terminal


5
投票

我使用来自synocommunity的GateOne

进入Package Center中的设置并添加http://packages.synocommunity.com/作为包源。然后,您应该可以通过Package Center轻松添加它。


4
投票

当前的Windows 10(版本1803(OS Build 17134.1))内置了SSH。这样,只需从控制面板,终端和SNMP启用SSH,确保您使用的是管理员组中的帐户,并且您都是组。

启动Powershell或CMD,输入ssh yourAccountName @ diskstation

它第一次缓存你的证书。


4
投票

对于我的例子:

Windows XP ---> Synology:DS218 +

  • Step1: > DNS: Control Panel (控制台) > Terminal & SNMP(終端機 & SNMP)
  • Step2: Enable Telnet service (启动 Telnet 功能) or Enable SSH Service (启动 SSH 功能) enter image description here enter image description here
  • 步骤3:在Windows上启动终端(或通过执行 CMD 推出终端) enter image description here
  • Step4:输入:telnet your_nas_ip_or_domain_name,如下所示 telnet 192.168.1.104 enter image description here

  • 第五步: 演示终端应用程序,比如编译Java代码

    Fzz login: tsungjung411

    Password:

    # shows the current working directory (顯示目前的工作目錄)
    $ pwd
    /var/services/homes/tsungjung411


    # edit a Java file (via vi), then compile and run it 
    # (透過 vi 編輯 Java 檔案,然後編譯和執行)
    $ vi Main.java

    # show the file content (顯示檔案內容)
    $ cat Main.java
    public class Main {
        public static void main(String [] args) {
            System.out.println("hello, World!");
        }
    }

    # compiles the Java file (編譯 Java 檔案)
    javac Main.java

    # executes the Java file (執行 Java 檔案)
    $ java Main
    hello, World!

    # shows the file list (顯示檔案清單)
    $ ls
    CloudStation  Main.class  Main.java  www

enter image description here


    # shows the JRE version on this Synology Disk Station
    $ java -version
    openjdk version "1.8.0_151"
    OpenJDK Runtime Environment (IcedTea 3.6.0) (linux-gnu build 1.8.0_151-b12)
    OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)


  • 第六步: 演示另一个终端应用程序,比如运行Python代码

    $ python
    Python 2.7.12 (default, Nov 10 2017, 20:30:30)
    [GCC 4.9.3 20150311 (prerelease)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> import sys
    >>>
    >>> # shows the the python version
    >>> print(sys.version)
    2.7.12 (default, Nov 10 2017, 20:30:30)
    [GCC 4.9.3 20150311 (prerelease)]
    >>>
    >>> import os
    >>>
    >>> # shows the current working directory
    >>> print(os.getcwd())
    /volume1/homes/tsungjung411

enter image description here


    $ # launch Python 3
    $ python3
    Python 3.5.1 (default, Dec  9 2016, 00:20:03)
    [GCC 4.9.3 20150311 (prerelease)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>


© www.soinside.com 2019 - 2024. All rights reserved.