Gerrit Set-Account

使用Gerrit set-account命令可以对Gerrit用户进行配置、查询信息等操作

帮助命令:ssh -p 29418 user@192.168.1.1 gerrit set-account --help

gerrit set-account USER [--] [--active] [--add-email EMAIL] [--add-ssh-key -|KEY] [--clear-http-password] [--delete-email EMAIL] [--delete-ssh-key -|KEY] [--full-name NAME] [--generate-http-password] [--help (-h)] [--http-password PASSWORD] [--inactive] [--preferred-email EMAIL] [--trace] [--trace-id VAL]

 USER                     : full name, email-address, ssh username or account id
 --                       : end of options (default: false)
 --active                 : set account's state to active (default: false)
 --add-email EMAIL        : email addresses to add to the account
 --add-ssh-key -|KEY      : public keys to add to the account
 --clear-http-password    : clear HTTP password for the account (default: false)
 --delete-email EMAIL     : email addresses to delete from the account
 --delete-ssh-key -|KEY   : public keys to delete from the account
 --full-name NAME         : display name of the account
 --generate-http-password : generate a new HTTP password for the account
                            (default: false)
 --help (-h)              : display this help text (default: true)
 --http-password PASSWORD : password for HTTP authentication for the account
 --inactive               : set account's state to inactive (default: false)
 --preferred-email EMAIL  : a registered email address from the account
 --trace                  : enable request tracing (default: false)
 --trace-id VAL           : trace ID (can only be set if --trace was set too)

生成用户http密码:

ssh -p 29418 user@192.168.1.1 gerrit set-account user --generate-http-password

添加public key:

cat ~/.ssh/id_rsa.pub | ssh -p 29418 gerrit_address gerrit set-account --add-ssh-key - jenkins

测试连接:

ssh -p 29418 10.211.211.211

配置账号:

Host 10.2.2.2
    HostName 10.2.2.2
    User jenkins
    IdentityFile ~/.ssh/id_rsa
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

删除Gerrit用户:

删除Gerrit用户
git clone /srv/gerrit/git/All-Users.git
cd All-Users
git fetch origin refs/meta/external-ids:refs/remotes/origin/meta/external-ids
git checkout FETCH_HEAD
git push origin HEAD:refs/meta/external-ids
ssh -p 29418 user@gerrit_IP gerrit flush-caches --all

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值