赞
踩
- docker run -d \
- --name homeassistant \
- --privileged \
- --restart=unless-stopped \
- -e TZ=MY_TIME_ZONE \
- -v /etc/docker/ha:/config \
- -v /run/dbus:/run/dbus:ro \
- -p 8123:8123 \
- ghcr.io/home-assistant/home-assistant:stable
如果您在容器中运行“家庭助理”,则可以使用容器中的命令行和命令来更改密码。以下步骤是指 Docker 中名为 的 Home Assistant 容器。请注意,在容器中工作时,命令需要一些时间才能执行。hass
homeassistant
docker exec -it homeassistant bash
打开到容器命令行hass
创建默认用户(如果这是您首次使用该工具)hass --script auth --config /config change_password existing_user new_password
更改密码exit
退出容器命令行docker restart homeassistant
重新启动容器。用户名密码存放位置
- find / -name auth_provider.homeassistant
- /config/.storage/auth_provider.homeassistant
-
-
- cat /config/.storage/auth_provider.homeassistant
- {
- "version": 1,
- "minor_version": 1,
- "key": "auth_provider.homeassistant",
- "data": {
- "users": [
- {
- "username": "******",
- "password": "**********************************************************************"
- }
- ]
- }
- }
- ~
- ~

重置密码
- docker exec -it homeassistant /bin/bash
-
- hass --script auth --config /config change_password 用户名 新密码
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。