Coolify logoCoolify

手动禁用 2FA

如果你丢失了 2FA 设备或遇到其他问题,并且能够访问你的服务器,你可以手动禁用 2FA。

1. 通过 SSH 登录到你的服务器

ssh your-server-ip

2. 运行以下命令进入 coolify 容器

docker exec -it coolify sh

3. 进入 Tinker

php artisan tinker

4. 查找你的用户 ID

如果是 root 用户,你必须使用 0 作为用户 ID。

$user_id = 0;

对于其他所有用户,使用以下命令获取用户 ID。

$user_id = User::whereEmail('your-email')->first()->id;

5. 禁用 2FA

User::find($user_id)->update([
  'two_factor_secret' => null,
  'two_factor_recovery_codes' => null,
  'two_factor_confirmed_at' => null
]);

On this page