gitlbab用户信息以邮箱为准,如果ad域邮箱变更时 gitlab会新建账户,如果重名会导致用户后缀加1顺延(比如joy.zhou1) 由于之前组权限给的都是joy.zhou导致 代码拉取能正常,但是登陆跳转到joy.zhou1找不到项目。
因为邮箱是唯一值,只能从数据库修改
登陆giltab 数据库可参考
yum安装默认登录postgresql
su - gitlab-psql
psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
\l //查看数据库 \dt //查看多表 \d abuse_reports //查看单表 select * from users where id=42; //必须要;不然不执行查询 把原来帐号的邮箱改成可以ldap认证的域名 update users set email ='joy.zhou@qq.com' where id = 74; //把原来帐号的邮箱改成可以ldap认证的域名
/opt/gitlab/bin
修改密码 旧版本 gitlab-rails console production
新版本 gitlab-rails console -e production
user = User.where(username:"root").first
user.password = "test123@"
user.save!