gitlab重置password

ruby没怎么学,自己搭建的gitlab的rootpassword又忘了。幸好看见此帖子,试验ok

http://roland.kierkels.net/git/reset-your-gitlab-root-password-from-a-terminal/

RESET YOUR GITLAB ROOT PASSWORD FROM A TERMINAL

October 24, 2014 · by rcjkierkels ·
in Git

Seriously ‘Invalid email or password’. I know for sure that it was correct, or wasn’t it?

Are you in the same situation and resetting your password the old school way doesnt work for you then here is a solution
to hack your back into GitLab. To make this work you need of course root access to your GitLab server.

Start by logging into your server with root privileges. Then start a Ruby on Rails console. Don’t worry if you have never worked before in Ruby, I hadn’t too, its really easy!

Start the console with this command:

1

> gitlab-rails console production

Next wait until the console has loaded. You will see something like this if everything is OK:



Gitlab Rails Console

Now there are multiple ways to find your user. In my case I know there was only one user and it had so it has ID 1. But you can also search for email or username.

1

irb(main):001:0>
u
=
User.where(id:
1).first

//这个命令会看见你的账户信息

Now lets change your password:

1

2

> u.password = ‘secret_pass‘

> u.password_confirmation = ‘secret_pass‘

Its important that you change both password and password_confirmation to make it work.
Now lets save the changes.

1

>
u.save!

The ( ! ) symbol is very important. Otherwise your changes are not pushed to the database. Now exit the console and try to login with your new password. It should work now.

时间: 2024-12-19 22:15:38

gitlab重置password的相关文章

gitlab重置用户密码

用户lms登录gitlab的密码忘记了,需要重置密码. gitlab重置用户lms的密码: [[email protected] ~]# gitlab-rails console production  #进入gitlab管理控制台 Loading production environment (Rails 4.2.4) irb(main):001:0> user=User.where(name: "lms").first  #查找gitlab用户lms,一般情况通过名字查找比较

gitlab重置密码

ruby没怎么学,自己搭建的gitlab的root密码又忘了,幸好看见此帖子,试验ok http://roland.kierkels.net/git/reset-your-gitlab-root-password-from-a-terminal/ RESET YOUR GITLAB ROOT PASSWORD FROM A TERMINAL October 24, 2014 · by rcjkierkels · in Git Seriously 'Invalid email or passwor

gitlab重置root的密码

gitlab管理员帐号可以给普通用户创建账户,分配权限,拥有所有项目和组的权限,普通用户新建完成之后,需要管理员给分配合适的权限,才能正常的使用.如果管理员账户的密码忘记了,一般可以通过邮箱找回,但如果当初的管理账户设置的邮箱不可使用了,其实还可以强制重置的方式来找回密码的,下面就来介绍下如何强制找回 解决:gitlab-ctl start?保证gitlab处于启动状态,&保证redis处于启动状态gitlab-rails console production?进入gitlab串口环境下irb(

Gitlab数据备份及数据恢复重置gitlab管理密码方法

一.创建备份文件首先我们得把老服务器上的Gitlab整体备份,使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份. gitlab完全备份命令: gitlab-rake gitlab:backup:create 使用以上命令会在/var/opt/gitlab/backups目录下创建一个名称类似为1545200330_2018_12_19_11.3.13_gitlab_backup.tar的压缩包, 这个压缩包就是Gi

GitLab11.3.9 使用 Crowd3.3.2 的帐号实现 SSO 单点登录,以及GitLab配置腾讯企业邮箱

GitLab11.3.9 的安装方法: 点击查看. ??Crowd3.3.2 的安装方法:点击查看. ??需要先在 Crowd 创建应用程序,参考 <Docker 创建 Crowd3.3.2 以及打通 Jira Software7.12.3和Confluence6.12.2 SSO 单点登录> 中的 4.12章节,在 Application type 选择 Generic Application, Description 输入Gitlab Applicaton, Name 输入 gitlab,

centos6.5安装部署git服务器(gitlab)

环境准备 python版本2.6 git版本 1.8.4.1 ruby版本ruby-2.0.0-p353 gitlab-shell版本 v1.8.0 gitlab版本6.4.3 因centos6系列的python版本是2.6的,已经支持,所以不必升级python版本. 在centos5下面需要升级python版本>2.5 安装epel的yum源 1 yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-

Gitlab - docker 安装实例

在动手安装了一遍 gitlab 之后,发现了一篇利用 docker-compose 安装的文章,测试了一下,可行,完善了一下和大家分享分享. 1.准备工作  yum install -y epel-release    //安装扩展源,装pip yum install -y docker  python-pip   //安装docker和pip pip install docker-compose mkdir -p /opt/data/docker_gitlab/{gitlab,postgres

gitlab部署

一.配置epel源 wget   http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm  -ivh  epel-release-6-8.noarch.rpm 二.安装依赖包 yum -y install libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make cmake autoconf aut

访问GitLab的PostgreSQL数据库

1.登陆gitlab的安装服务查看配置文件 cat /var/opt/gitlab/gitlab-rails/etc/database.yml production: adapter: postgresql encoding: unicode collation: database: gitlabhq_production //数据库名 pool: 10 username: 'gitlab' //用户名 password: host: '/var/opt/gitlab/postgresql' /