Loading... Gitlab修改用户密码 1. 打开rails控制台,并在控制台中执行2-5的步骤。 ```shell sudo gitlab-rails console ``` 2. 根据用户名或者用户ID找到user; - 根据用户名 ```shell user = User.find_by_username 'yourusername' ``` - 根据用户ID ```shell user = User.find(123) ``` - 根据邮箱地址: ```shell user = User.find_by(email: 'user@example.com') ``` 3. 重设密码 ```shell new_password = 'examplepassword' #or new_password = ::User.random_password user_password = new_password user.password_confirmation = new_password ``` 4. 邮件通知 ```shell user.send_only_admin_changed_your_password_notification! ``` 5. 保存并退出 ```shell user.save! exit ``` 6. 如果还是不行,则重启下gitlab ```shell gitlab-ctl restart ``` © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 If you think my article is useful to you, please feel free to appreciate