诚信为本,市场在变,诚信永不变......亚飞网络欢迎您......

存储技术

Synology 群晖 ssh 命令清单大全(附命令解释说明)

作者:小编 更新时间:2023-04-28 点击数:

群晖科技

给所有书的通知。如果你复制维基并窃取真正的开发人员工作不会让你成为黑客。

请注意,某些命令可能会擦除数据,因此请仔细阅读。

通过 OPKG 在 Synology NAS 上安装各种软件包(脚本可在此处找到 - My Synology Nas: DS416)

备忘单

NAS 打印工作组:

 synowin -getWorkgroup

加入新的 NAS 工作组:

 synowin -joinWorkgroup <group>

打印一般信息:

  synoservice --status

通过 cli 设置邮件:

  synosyslogmail

检查升级:

  synoupgrade --check 3

转储有关 NAS 的数据:

 syno_system_dump

打印网络信息,包括当前双面打印器:

 synonet --show

打印当前主机名:

 synonet --get_hostname

设置新主机名:

synonet --set_hostname

设置新网关:

synonet --set_gateway gateway

沃尔唤醒:

synonet --wake xx:xx:xx:xx:xx:xx <interface>

打印分区布局表。

synopartition --list

共享

打印有关共享的信息:
synoshare --get <sharefolder>
挂载共享加密文件夹:
synoshare --enc_mount <sharefolder> <password>
卸载加密文件夹:
synoshare --enc_unmount <sharefolder>
允许删除:
synoshare --del {TRUE|FALSE} sharename1 sharename2 ...
设置共享文件夹的说明(在文件浏览器的注释中查看)
synoshare --setdesc sharename desc
允许浏览共享文件夹
synoshare --setbrowse sharename browse_flag{0|1}
重命名共享文件夹:
synoshare --rename  old_sharename new_sharename
Set users that is allowed to browse shared folder:
synoshare --setuser sharename user_auth{NA|RO|RW} operator{+|-|=} user_name_list_with_comma

User

Print main data about a user

sh-4.3# synouser --get wuseman
User Name   : [wuseman]
User Type   : [AUTH_LOCAL]
User uid    : [1026]
Primary gid : [100]
Fullname    : []
User Dir    : [/var/services/homes/wuseman]
User Shell  : [/bin/sh]
Expired     : [false]
User Mail   : []
Alloc Size  : [82]
Member Of   : [2]
(100) users
(101) administrators

Set a new password/Change password:

synouser --setpw oldpassword newpassword

Rename a user:

synouser --rename old_username new_username

添加包含完整信息的用户名:

synouser --add [username pwd "full name" expired{0|1} mail privilege]

通知:

发送有关存储的电子邮件:

synostorage --mail

锁管理

synostorage --lock

调优功能:

获取当前调优配置文件:
synotune --get   
Outut: Current Profile: performance_throughput

设置新功能,选项:

synotune --set    performance_throughput OR performance_latency

转储有关您的群晖网络的信息:

syno_system_dump

升级

设置您的 NAS 以自动处理升级:
synoupgrade --auto
检查当前的升级设置:
synoupgrade --check
如果有新升级,请下载***新升级:
synoupgrade --download
开始升级:
synoupgrade --start

检查分区布局表:

synopartition --check /dev/sd<X>

查看群晖 NFS 监视器:

synonfstop

截图

重置您的群晖 NAS(仅限设置)

 /usr/syno/sbin/./synodsdefault --reset

将您的 Synology Nas 重置为出厂默认设置(OBS OBS OBS OBS 所有数据将被擦除)

 /usr/syno/sbin/./synodsdefault --factory-default

重新安装您的 Synology Nas 工作站,所有数据将被保留:

 /usr/syno/sbin/./synodsdefault --reinstall; reboot

The proper way to restart SSHD of your NAS via cli:

 synoservicectl --restart sshd

List, uninstall or install a .spk package file (available locally)

  synopkg

Install a set a networking and ELF binary debugging tools (and drop into a root session)

 synogear

Write and read an .ini style file with lines of key=value pairs

 synosetkeyvalue
 synogetkeyvalue

Shut down and power off the NAS (much like shutdown -h now)

 synopoweroff

Show installed packages

 synopkg list | sed 's/: .*$//'

Uninstall a package

 sudo synopkg uninstall

Synology Shutdown and Poweroff Too

 syno_poweroff_task

Set/establish password to local user

 synoauth local_username password

Manage IP autoblock feature

 synoautoblock OPTIONS

Manage blog feature

 synoblog_backup [-r|-b] p [-u username] [-o]

Synology disk control device: something like /dev/hda or /dev/sda

 syno_disk_ctl OPTIONS DEVICE

Synology clear .tbd-File Tool

 SYNOClearTdb FILE

Different ways to print various info about your NAS

 more /etc.defaults/VERSION 
 cat /etc/synoinfo.conf
 cat /proc/cmdline
 synoshare --enum ALL 
 synonet --show 
 synodisk --enum 
 synospace --enum -a

Restart index

 synoservicectl --restart synoindexd

Check for upgrades

 sudo synoupgrade --check

Restart webserver

 /usr/syno/sbin/synoservicecfg --restart httpd-user 
 /usr/syno/sbin/synoservicectl --restart pkgctl-WebStation

Generate a list for what you can control

 /usr/syno/sbin/synoservice --list

DSM API - Provide DSM information

 syno dsm getInfo --pretty

File Station API - Provide File Station information

 syno fs getInfo --pretty

File Station API - Enumerate files in a given folder

 syno fs listFiles --payload '{"folder_path":"/path/to/folder"}' --pretty

Download Station API - List download tasks

 syno dl listFiles --payload '{"limit":5, "offset":10}' --pretty

Download Station API - Create a download task

 syno dl createTask --payload '{"uri":"https://link"}'

Audio Station API - Search a song

 syno as searchSong --payload '{"title":"my_title_song"}' --pretty

Video Station API - List movies

 syno vs listMovies --payload '{"limit":5}' --pretty

Video Station DTV API - List channels

 syno dtv listChannels --payload '{"limit":1}' --pretty

Surveillance Station API - Get camera information

 syno ss getInfoCamera --payload '{"cameraIds":8}' --pretty

Restart, enable, stop samba

 /usr/syno/etc/rc.sysv/S80samba.sh --help

Get synology date

 synodate --getSysDate

Printer stuff

synoprint

Update index older

indexfolder --type={SHARE_CREATE|SHARE_REMOVE} --share=<SHARED_FOLDER> --share_path=<SHARED_FOLDER>

Start mediaserver

/usr/syno/bin/mediaserver.sh start

CAREFUL, KILLING NAS

servicetool --get-service-volume download

Get 2FA key if lost

ssh root@nas cat /usr/syno/etc/preference/wuseman/google_authenticator

List disk info on a very fancy way

dhm_tool -s

Synology Autoblock

I have seen many threads on synology forum about this topic, DON'T touch the DB file if you really don't need, use synoautoblock command instead, see examples below:

Add a IP to autoblock db:

synoautoblock --deny <ip-address>

Reset a IP that has been added by mistake:

synoautoblock --reset <ip-address>

Add any IP to whitelist:

synoautoblock --in-white-list <ip-address>

Debugging & System Health:

Debug fans and email the result (if email has been set)

syno_fan_debug

Run a health check of your system and email the the result once done:

syno_disk_health_record

Check ~remain lifetime:

syno_disk_remain_life_check

Run smartmontools and send email once done:

syno_disk_smart_mail_send

Debug hibernation:

syno_hibernation_debug

LED (Get min and max value in: /usr/syno/etc.defaults/led_brightness.xml)

Get current setup:
syno_led_brightness --get (Default on DS416: 1985157252)
设置新设置:
syno_led_brightness --set <brightness>

带宽

打印用户带宽使用情况:
synobandwidth --status [<list=user|group|all(default)> <transfer=upload|download|all(default)>] <merge=0|1(default)>]
为用户设置新的带宽限制:
synobandwidth --set-global-conf <state=enabled|disabled> [<protocol=filestation|webdav|ftp|rsync|all(default)>
按用户打印所有服务的状态:
 sh-4.3# synobandwidth --preview wuseman
    Protocol     Upload   Download
    filestation  0.00       0.00
    webdav       0.00       0.00
    ftp          0.00       0.00
    rsync        0.00       0.00

伊西

群晖 iSCSI 性能分析器

synoiscsitop40

截图

设置风扇配置(***响亮的声音听起来像飞机)

 synofanconfig -parseXML 1000000

列出了更多 synology 命令:

 sync
 synologconvert
 syno-dbus-check.sh
 synologrotated
 syno-letsencrypt
 synologset
 syno-move-coredump
 synologset1
 syno8021Xtool
 synolunbackup
 synoRTCTime
 synolunbkp
 syno_adv_test
 synoluntransform
 syno_dc_ctrl_adapter.sh
 synomediaparserd
 syno_disk_config_check
 synomkflv
 syno_disk_ctl
 synomkflvd
 syno_disk_data_collector
 synomkthumb
 syno_disk_db_update
 synomkthumbd
 syno_disk_dsl
 synomoduletool
 syno_disk_health_record
 synomount
 syno_disk_information_daily_record
 synomustache
 syno_disk_log_convert
 synomyds
 syno_disk_log_import_from_xml
 synonclient_send
 syno_disk_remain_life_check
 synonet
 syno_disk_smart_mail_send
 synonetd
 syno_disk_test_log_import_from_xml
 synonetdtool
 syno_disk_test_scheduler_set
 synonetseqadj
 syno_disk_testlog_convert
 synonfstop
 syno_disk_wcache_config_init
 synonotify
 syno_dvb_admin.sh
 synootp
 syno_fan_debug
 synoovstool
 syno_hdd_util
 synopartition
 syno_hibernation_debug
 synopasswordmail
 syno_hw_video_transcoding.sh
 synopayment
 syno_iptables_common
 synoperfeventd
 syno_led_brightness
 synoperformancediagnose
 syno_mem_check
 synopftest
 syno_pkgicon_sprite.py
 synophoto_acl
 syno_poweroff_task
 synophoto_acl_pgsql
 syno_scemd_connector
 synophoto_autoblock
 syno_smart_result_collect
 synophoto_backup
 syno_smart_test
 synophoto_config
 syno_ssd_trim
 synophoto_config_root
 syno_system_dump
 synophoto_dsm_user
 synoabnormalloginmail
 synophoto_external_access
 synoacltool
 synophoto_extract_preview
 synoagentregisterd
 synophoto_music
 synoappbkp
 synophoto_sdk_share_set
 synoappnotify
 synophoto_sns_utils
 synoapppriv_updater
 synophoto_update_db
 synoarchivetool
 synophoto_watermark_util
 synoauth
 synophotoio
 synoautoblock
 synopingpong
 synobackup
 synopkg
 synobackupd
 synopkgctl
 synobandwidth
 synopkghelper
 synoblog_backup
 synoplatform
 synobootseq
 synoportforward
 synobootupcheck
 synopoweroff
 synobtrfssnap
 synopreferencedir
 synocacheclient
 synoprint
 synocachepinfiletool
 synopsql
 synocachepinfiletool-status
 synoquota
 synocachepinfiletoolha
 synoraidtool
 synocerttool
 synorecycle
 synocfgen
 synorelayd
 synocgid
 synoretainer
 synocgitool
 synoretention-lun
 synocheckhotspare
 synoretentionconf
 synocheckiscsitrg
 synoretentiontest
 synochecknetworkcfg
 synoretentiontestutil.sh
 synocheckshare
 synorouterportfwd
 synocheckswapconfig
 synoroutertool
 synocloudserviceauth
 synorsyncdtool
 synocmsclient
 synosavetime
 synocodectool
 synoscgi
 synoconfbkp
 synoscgi________________________________________________________
 synoconfd
 synoschedtask
 synocontentextract
 synoschedtool
 synocontentextractd
 synoscimprofile
 synocopy
 synosdutils
 synocredential
 synosearch
 synocrond
 synosearchagent
 synocrtregister
 synoselfcheck
 synocrtunregister
 synoservice
 synodatacollect
 synoservicecfg
 synodataverifier
 synoservicectl
 synodate
 synoservicemigrate
 synodctest
 synosetkeyvalue
 synodd
 synoshare
 synoddnsinfo
 synosharequota
 synoddsmtool
 synosharesnapshot
 synodisk
 synosharesnaptool
 synodiskdatacollect
 synosharesnaptree
 synodiskfind
 synosharingbackup
 synodiskpathparse
 synosharingchecker
 synodiskport
 synosharingcron
 synodriveencode
 synosharingurl
 synodrivehook
 synosmartblock
 synodriveindex
 synosnapschedtask.sh
 synodriveobject
 synosnmpcd
 synodrivesettings
 synospace
 synodriveversion
 synospace.sh
 synodrivevolume
 synosshdutils
 synodsdefault
 synostgpool
 synodsinfo
 synostgsysraid
 synodsmnotify
 synostgvolume
 synoeaupgrade
 synostorage
 synoethinfo
 synostoragecore
 synoexternal
 synostoraged
 synofanconfig
 synosupportchannelchecker
 synofileutil
 synosyncdctime
 synofirewall
 synosyslogmail
 synofirewallUpdater
 synotc
 synoflashcache
 synotc_common
 synoflvconv
 synothumb
 synofstool
 synotifyd
 synogear
 synotifydutil
 synogetkeyvalue
 synotimecontrol
 synogpoclientd
 synotlstool
 synogrinst
 synotune
 synogroup
 synotunnelexec
 synoguest
 synoupgrade
 synohacore
 synoupnp
 synoindex
 synoups
 synoindex_mgr
 synoupscommon
 synoindex_package.sh
 synousbcam
 synoindexd
 synousbcopy
 synoindexplugind
 synousbdisk
 synoindexscand
 synousbmodemd
 synoindexworkerd
 synouser
 synoiscsiep
 synouserdir
 synoiscsihook
 synouserhome
 synoiscsitool
 synovolumesnapshot
 synoiscsitop
 synovpnc
 synoiscsitop40
 synovspace
 synoiscsiunmap
 synovspace_wrapper
 synoiscsiwebapi
 synow3
 synoisns
 synow3tool
 synokerneltz
 synowebapi
 synolanstatus
 synowifid
 synoldapclient
 synowin
 synoldapclientd
 synowireless
 synologaccd
 synowsdiscoveryd
 synologand
 synowstransferd
 synologanutil
 synozram
 synologconfgen


加入收藏

联系我们

电话:0791-86109380

传 真:0791-86109380

手 机:18179329180

邮 箱:yf@yf26.cn

地 址:江西省南昌市广场南路6号