• Gitlab的用户、组、权限的分配与管理管理


    转载:https://blog.51cto.com/liqingbiao/2453796

    (一)、添加用户
    1、用root管理员登陆,点击管理区域
    Gitlab的用户、组、权限的分配与管理管理(二)
    2、点击New User,并输入相关的信息。
    Gitlab的用户、组、权限的分配与管理管理(二)
    3、点击确定后输入相关的密码
    Gitlab的用户、组、权限的分配与管理管理(二)

    (二)、创建组
    1、点击管理区域,选择组
    Gitlab的用户、组、权限的分配与管理管理(二)
    2、依次编辑相关的账号信息
    Gitlab的用户、组、权限的分配与管理管理(二)
    3、编辑组,并添加相应的用户
    Gitlab的用户、组、权限的分配与管理管理(二)

    Gitlab的用户、组、权限的分配与管理管理(二)
    可以通过输入名字选择要分配权限的小组成员,然后分配角色,选择权限有效时间,点击Add to Project就把人员拉近到项目中。GitLab的角色有以下四种:

    Guest:可以创建issue、发表评论,不能读写版本库
    Reporter:可以克隆代码,不能提交,可以赋予测试、产品经理此权限
    Developer:可以克隆代码、开发、提交、push,可以赋予开发人员此权限
    MainMaster:可以创建项目、添加tag、保护分支、添加项目成员、编辑项目,一般GitLab管理员或者CTO才有此权限

    (三)、创建项目并分配相关的权限
    1、单击项目,并创建项目
    Gitlab的用户、组、权限的分配与管理管理(二)
    Gitlab的用户、组、权限的分配与管理管理(二)
    2、给该项目选择成员或组,并分配相应的角色。具体如下,进入项目---setting---members---指定用户或组分配权限和角色----最后添加到项目中。
    Gitlab的用户、组、权限的分配与管理管理(二)

    3、查看相关的权限
    Gitlab的用户、组、权限的分配与管理管理(二)

    后续:强制禁用gitlab的双因子认证:Two-Factor Authentication,如果不禁用的话,什么都做不成。
    Gitlab的用户、组、权限的分配与管理管理(二)

    具体解决方法如下:
    1、查看gitlab安装时的postgresql的相关信息

    [root@otrs004097 ~]# cat /var/opt/gitlab/gitlab-rails/etc/database.yml 
    # This file is managed by gitlab-ctl. Manual changes will be
    # erased! To change the contents below, edit /etc/gitlab/gitlab.rb
    # and run `sudo gitlab-ctl reconfigure`.
    
    production:
      adapter: postgresql
      encoding: unicode
      collation: 
      database: gitlabhq_production
      pool: 10
      username: "gitlab"
      password: 
      host: "/var/opt/gitlab/postgresql"
      port: 5432
      socket: 
      sslmode: 
      sslcompression: 0
      sslrootcert: 
      sslca: 
      load_balancing: {"hosts":[]}
      prepared_statements: false
      statements_limit: 1000
      fdw: 

    2、连接到gitlabhq_production库

    [root@otrs004097 ~]# su - gitlab-psql
    Last login: Tue Nov 26 15:21:31 CST 2019 on pts/0
    -sh-4.2$ psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
    psql (10.9)
    Type "help" for help.
    
    gitlabhq_production=# l
    gitlabhq_production=# SELECT name,username,otp_required_for_login,two_factor_grace_period, require_two_factor_authentication_from_group   FROM users;
         name      | username | otp_required_for_login | two_factor_grace_period | require_two_factor_authentication_from_group 
    ---------------+----------+------------------------+-------------------------+----------------------------------------------
     yw            | yw       | f                      |                      48 | f
     lqb           | lqb      | f                      |                      48 | t
     ops           | yunwei   | f                      |                      48 | f
     dev           | dev1     | f                      |                      48 | f
     test          | test1    | f                      |                      48 | f
     Administrator | root     | f                      |                      48 | f
    (6 rows)
    
    gitlabhq_production=# UPDATE users set require_two_factor_authentication_from_group = 'f' WHERE username = 'root';
    UPDATE 1
  • 相关阅读:
    小知识积累C++使用tinyxml解析Xml内存泄漏问题
    C/C++心得从内存开始
    C/C++心得理解指针
    C/C++心得面向对象
    对于语言的理解
    Lua脚本认知小结
    从敏捷开发到小团队SVN
    如何制作网页小动画?——gif or png
    华为数据之道_简读
    Python_读取文件替换字符
  • 原文地址:https://www.cnblogs.com/ruiati/p/13803408.html
Copyright © 2020-2023  润新知