armbian docker 部署 homeassistant && 忘记密码重置密码

复制代码
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

  1. docker exec -it homeassistant bash打开到容器命令行
  2. hass创建默认用户(如果这是您首次使用该工具)
  3. hass --script auth --config /config change_password existing_user new_password更改密码
  4. exit退出容器命令行
  5. 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 用户名 新密码
相关推荐
Patrick_Wilson7 小时前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy17 小时前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭17 小时前
运行你的第一个Docker容器
后端·docker·容器
宋均浩2 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
程序员老赵2 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1113 天前
LM Studio Docker 部署——本地大模型一键启动
docker
曲幽4 天前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
武子康5 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
Alsn868 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
程序员老赵9 天前
服务器没有桌面?Docker 跑个 Chrome,浏览器就能远程用
docker·容器·devops