群晖炸机自救恢复笔记
起因
群晖硬件层过热导致网卡频繁断流、丢包、掉线,为了解决这一问题,我购买了两个12cm的风扇并安装在机器上。然而,这一举动却带来了新的问题。
状态
尽管群晖正常引导启动,但使用搜索工具仍无法成功联网。所有的网页项目都无法访问,这使得服务器的功能严重受到限制。
尝试恢复
1. 修复网络
首先,我尝试通过群晖搜索工具登录账户,尝试将IP地址更改为DHCP或手动配置,但均未成功完成联网操作。我随后尝试更换网口,甚至重启机器,但问题依然存在。
2. 重建引导
鉴于前一步骤的无果,我决定重新制作引导U盘。尽管此举在搜索工具上显示了联网状态,但在恢复引导后,问题依然未解决。通过在Windows上映射的共享文件夹可以正常访问的发现,我推断系统已经成功启动,只是web页面无法正常访问。
3. 检查Nginx
为了进一步排查问题,我通过SSH登录root账户检查了nginx状态。令人意外的是,我发现服务已经启动,端口占用也正常。
成功访问
通过上述步骤的排查,我基本确认了群晖已经成功启动,仅存在web页面无法访问的问题。通过SSH登录root账户,重置用户配置后,我终于成功打开了web页面。仅有少数docker macvlan丢失,但经过重新配置后一切恢复正常。这次经历可以说是非常幸运的,同时也提醒我安全与便利之间需要平衡,尤其在长期开启SSH时切勿保存密码。
群晖命令集
1. 常用命令
NAS 打印工作组:
synowin -getWorkgroup
加入新的 NAS 工作组:
synowin -joinWorkgroup
打印一般信息:
synoservice –status
通过 cli 设置邮件:
synosyslogmail
检查升级:
synoupgrade –check 3
转储有关您的 nas 的数据:
syno_system_dump
打印网络信息包括。当前双工:
synonet –show
打印当前主机名:
synonet –get_hostname
设置一个新的主机名:
synonet –set_hostname
设置新网关:
synonet –set_gateway gateway
WOL 唤醒:
synonet –wake xx:xx:xx:xx:xx:xx
打印分区布局表。
synopartition –list
2. 共享相关命令
打印有关共享的信息:
synoshare –get
挂载共享加密文件夹:
synoshare –enc_mount
卸载加密文件夹:
synoshare –enc_unmount
允许删除:
synoshare –del {TRUE|FALSE} sharename1 sharename2 …
为共享文件夹设置描述(在文件浏览器的评论中查看)
synoshare –setdesc sharename desc
允许浏览共享文件夹
synoshare –setbrowse sharename browse_flag{0|1}
重命名共享文件夹:
synoshare –rename old_sharename new_sharename
设置允许浏览共享文件夹的用户:
synoshare –setuser sharename user_auth{NA|RO|RW} operator{+|-|=} user_name_list_with_comma
3. 用户相关命令
打印有关用户的主要数据
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
设置新密码/更改密码:
synouser –setpw oldpassword newpassword
重命名用户:
synouser –rename old_username new_username
添加包含完整信息的用户名:
synouser –add [username pwd “full name” expired{0|1} mail privilege]
4. 通知相关命令:
发送有关存储的电子邮件:
synostorage –mail
锁管理
synostorage –lock
5. 调优功能:
获取当前调整配置文件:
synotune –get
Outut: Current Profile: performance_throughput
设置新功能,选项:
synotune –set performance_throughput OR performance_latency
转储有关您的 Synology NAS 的信息:
syno_system_dump
6. 升级相关命令
将您的 nas 设置为自动处理升级:
synoupgrade –auto
检查您当前的升级设置:
synoupgrade –check
如果有新的,请下载最新的升级:
synoupgrade –download
开始升级:
synoupgrade –start
检查分区布局表:
synopartition –check /dev/sd
查看群晖 NFS 监视器:
synonfstop
7. 重置Synology Nas 和其它命令
重置 Synology NAS(仅限设置)
/usr/syno/sbin/./synodsdefault –reset
将 Synology Nas 重置为出厂默认设置(OBS OBS OBS ALL DATA 将被擦除)
/usr/syno/sbin/./synodsdefault –factory-default
重新安装 Synology Nas Station,将保留所有数据:
/usr/syno/sbin/./synodsdefault –reinstall; reboot
通过 cli 重启 NAS SSHD 的正确方法:
synoservicectl –restart sshd
列出、卸载或安装 .spk 包文件(本地可用)
synopkg
安装一组网络和 ELF 二进制调试工具(并进入根会话)
synogear
使用键=值对行编写和读取 .ini 样式文件
synosetkeyvalue
synogetkeyvalue
关闭并关闭 NAS(很像 shutdown -h now)
synopoweroff
显示已安装的包
synopkg list | sed ‘s/: .*$//‘
卸载软件包
sudo synopkg uninstall
Synology 也关机和关机
syno_poweroff_task
为本地用户设置/建立密码
synoauth local_username password
管理 IP 自动阻止功能
synoautoblock OPTIONS
管理博客功能
synoblog_backup [-r|-b] p [-u username] [-o]
Synology 磁盘控制设备:类似于 /dev/hda 或 /dev/sda
syno_disk_ctl OPTIONS DEVICE
Synology clear .tbd-文件工具
SYNOClearTdb FILE
打印有关 NAS 的各种信息的不同方法
more /etc.defaults/VERSION
cat /etc/synoinfo.conf
cat /proc/cmdline
synoshare –enum ALL
synonet –show
synodisk –enum
synospace –enum -a
重启索引
synoservicectl –restart synoindexd
检查升级
sudo synoupgrade –check
重启网络服务器
/usr/syno/sbin/synoservicecfg –restart httpd-user
/usr/syno/sbin/synoservicectl –restart pkgctl-WebStation
为您可以控制的内容生成列表
/usr/syno/sbin/synoservice –list
DSM API - 提供 DSM 信息
syno dsm getInfo –pretty
File Station API - 提供 File Station 信息
syno fs getInfo –pretty
File Station API - 枚举给定文件夹中的文件
syno fs listFiles –payload ‘{“folder_path”:”/path/to/folder”}’ –pretty
Download Station API - 列出下载任务
syno dl listFiles –payload ‘{“limit”:5, “offset”:10}’ –pretty
Download Station API - 创建下载任务
syno dl createTask –payload ‘{“uri”:”https://link“}’
Audio Station API - 搜索歌曲
syno as searchSong –payload ‘{“title”:”my_title_song”}’ –pretty
Video Station API - 列出电影
syno vs listMovies –payload ‘{“limit”:5}’ –pretty
Video Station DTV API - 列出频道
syno dtv listChannels –payload ‘{“limit”:1}’ –pretty
Surveillance Station API - 获取摄像头信息
syno ss getInfoCamera –payload ‘{“cameraIds”:8}’ –pretty
重新启动、启用、停止 samba
/usr/syno/etc/rc.sysv/S80samba.sh –help
获取 Synology 日期
synodate –getSysDate
打印机的东西
synoprint
更新索引较旧
indexfolder –type={SHARE_CREATE|SHARE_REMOVE} –share=
启动媒体服务器
/usr/syno/bin/mediaserver.sh start
小心,杀死NAS
servicetool –get-service-volume download
如果丢失,获取 2FA 密钥
ssh root@nas cat /usr/syno/etc/preference/wuseman/google_authenticator
以非常奇特的方式列出磁盘信息
dhm_tool -s
8. Synology 自动阻止
将 IP 添加到自动阻止数据库:
synoautoblock –deny
重置错误添加的IP:
synoautoblock –reset
将任何 IP 添加到白名单:
synoautoblock –in-white-list
9. 调试和系统健康:
调试风扇并通过电子邮件发送结果(如果已设置电子邮件)
syno_fan_debug
运行系统健康检查并在完成后通过电子邮件发送结果:
syno_disk_health_record
检查〜剩余寿命:
syno_disk_remain_life_check
运行 smartmontools 并在完成后发送电子邮件:
syno_disk_smart_mail_send
调试休眠:
syno_hibernation_debug
LED(获取最小值和最大值:/usr/syno/etc.defaults/led_brightness.xml)
获取当前设置:
syno_led_brightness –get (Default on DS416: 1985157252)
设置新设置:
syno_led_brightness –set
10. 带宽
打印用户带宽使用情况:
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
11. ISCI
Synology iSCSI 性能分析器
synoiscsitop40
4202977879.png
12. 风扇
设置风扇配置(最大声会听起来像飞机)
synofanconfig -parseXML 1000000
13. 列出了更多 Synology 命令:
sync
synologconvert
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
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
synodriveobject
synosnmpcd
synodrivesettings
synospace
synodriveversion
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