Git
[Gitlab] 사용자 비밀번호 변경(root 계정 포함)
H.Sunny,,
2023. 2. 21. 15:07
UI, Rake task, Rails console, Users API를 이용하여 사용자 패스워드를 변경할 수 있다.
이 글에서는 Rails console를 이용한 방법에 대해 포스팅 한다.
1. Rails console 열기
sudo gitlab-rails console
2. 변경할 사용자 찾기
user = User.find_by_username '사용자이름'
3. user.password 및 user.password_confirmation에 대한 값을 설정하여 암호 재설정
new_password = '변경할 패스워드'
user.password = new_password
user.password_confirmation = new_password
4. 저장
user.save!
5. Rails Console 종료
exit
출처 : https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password
Reset a user
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
docs.gitlab.com