开工

群晖内部许多设置都需要使用root用户身份才能修改,为此,需要知道其密码。

步驟1

群晖是利用`admin`用户设置root密码的,为此,需要先启用该用户

虽然我们登录的账户和admin同属于administrators用户组,但却不是System default user,无法修改root密码

步驟2

使用`ssh`连接群晖后键入两条命令即可
sudo su -
synouser --setpw root yourpassword

题外话

利用ssh连接时可能碰到

原因:重装了群晖但ip没变,而ssh“指纹”已经改变,需要用户重新授权连接

@lenovo ➜ ~  ssh admin@192.168.111.4
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:hgF1jJl93+tq6ZJvb1+HCABraLFftecVvrVr3cpvdOE.
Please contact your system administrator.
Add correct host key in /home/livejq/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/livejq/.ssh/known_hosts:6
  remove with:
  ssh-keygen -f "/home/livejq/.ssh/known_hosts" -R "192.168.111.4"
ECDSA host key for 192.168.111.4 has changed and you have requested strict checking.
Host key verification failed.

信息中已经给出了解决方法(移除旧的“指纹”重新授权添加)


@lenovo ➜ ~  ssh-keygen -f "/home/livejq/.ssh/known_hosts" -R "192.168.111.4"
# Host 192.168.111.4 found: line 6
/home/livejq/.ssh/known_hosts updated.
Original contents retained as /home/livejq/.ssh/known_hosts.old
@lenovo ➜ ~  ssh livejq@192.168.111.4                                        
The authenticity of host '192.168.111.4 (192.168.111.4)' can't be established.
ECDSA key fingerprint is SHA256:hgF1jJl93+tq6ZJvb1+HCABraLFftecVvrVr3cpvdOE.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.111.4' (ECDSA) to the list of known hosts.
livejq@192.168.111.4's password: 
Could not chdir to home directory /var/services/homes/livejq: No such file or directory

the end~

留言评论
推荐阅读