热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

架设Gitolite服务器

1.DownloadthesourcetreeofgitolitewhichispatchedbyJinagXin,aadvancedgitcontributerinchina.gitclonegit:github.comossxp-comgitolite.git2.Addagituserwhichisusedtoaccessgitserverforeachclientsinremotemachi

1. Download the source tree of gitolite which is patched by Jinag Xin, a advanced git contributer in china.

  1. git clone git://github.com/ossxp-com/gitolite.git 
2. Add a git user which is used to access git server for each clients in remote machine.
  1. sudo adduser --system --shell /bin/bash --gecos 'git version control' --group --disabled-password --home /home/gitolite gitolite

3. Back to the client and create a key pairs

  1. cd ~/.ssh  
  2. ssh-keygen -t rsa -f id_rsa_gitolite  
  3. cd ~

4. copy the public key to the home directory of git user - gitolite in remote machine.
  1. scp ~/.ssh/id_rsa_gitolite.pub mygitbox
  1. ssh mygitbox
  1. sudo cp id_rsa_gitolite.pub /home/gitolite  
  2. sudo chown gitolite:gitolite /home/gitolite/id_rsa_gitolite.pub 
5. Become the user gitolite and add the public key into the list of authorized keys so that can be used to log as this user.
  1. sudo su - gitolite
  1. mkdir .ssh  
  2. chmod 700 .ssh  
  3. cat id_rsa_gitolite.pub >> .ssh/authorized_keys  
  4. chmod 600 .ssh/authorized_keys  
  5. rm id_rsa_gitolite.pub

If you are using debian, above commands can be replaced by "ssh-copy-id gitolite@server"


6. Remove the line PublickeyAuthentication "no" in /etc/ssh/sshd_config on remote machine if it exists then restart sshd


7. Remove the line PublickeyAuthentication "no" in /etc/ssh/ssh_config on client machine


8. Modify ~/.ssh/config

  1. Host mygitbox  
  2.     User gitolite  
  3.     Hostname 10.42.43.13  
  4.     Port 22  
  5.     PreferredAuthentications publickey  
  6.     IdentityFile ~/.ssh/id_rsa_gitolite

9. Installation procedure on client machine

  1. cd gitolite/src  
  2. ./gl-easy-install gitolite mygitbox gitadmin

.ssh/authorized_keys will rename to old_authkeys and re-generate authorized_keys

New ~/.ssh/config shows:


10. Done

 


推荐阅读
  • 我创建了一个SSH密钥,当我以admin身份在GitBash中运行ssh-Tgit@gitlab.com时,我得到W ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
  • 本文介绍了Linux Shell中括号和整数扩展的使用方法,包括命令组、命令替换、初始化数组以及算术表达式和逻辑判断的相关内容。括号中的命令将会在新开的子shell中顺序执行,括号中的变量不能被脚本余下的部分使用。命令替换可以用于将命令的标准输出作为另一个命令的输入。括号中的运算符和表达式符合C语言运算规则,可以用在整数扩展中进行算术计算和逻辑判断。 ... [详细]
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • SpringBoot整合SpringSecurity+JWT实现单点登录
    SpringBoot整合SpringSecurity+JWT实现单点登录,Go语言社区,Golang程序员人脉社 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
  •     这里使用自己编译的hadoop-2.7.0版本部署在windows上,记得几年前,部署hadoop需要借助于cygwin,还需要开启ssh服务,最近发现,原来不需要借助cy ... [详细]
  • 大坑|左上角_pycharm连接服务器同步写代码(图文详细过程)
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了pycharm连接服务器同步写代码(图文详细过程)相关的知识,希望对你有一定的参考价值。pycharm连接服务 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了markdown[软件代理设置]相关的知识,希望对你有一定的参考价值。 ... [详细]
  • 现在比较流行使用静态网站生成器来搭建网站,博客产品着陆页微信转发页面等。但每次都需要对服务器进行配置,也是一个重复但繁琐的工作。使用DockerWeb,只需5分钟就能搭建一个基于D ... [详细]
  • systemd-nspawn可以创建最轻量级的容器(ns的意思就是namespace),本文的实验平台是Ubuntu16.04,x86_64机器。本文的目的是:在Ubuntu中用syst ... [详细]
  • LVS实现负载均衡的原理LVS负载均衡负载均衡集群是LoadBalance集群。是一种将网络上的访问流量分布于各个节点,以降低服务器压力,更好的向客户端 ... [详细]
  • 一、修改注册表去掉桌面图标小箭头1按下win+R组合快捷键,打开windows10系统的“运行”窗口,输入“regedit”,打开注册表编辑器,找到HKEY_CLASSES_ROOT\lnkfi ... [详细]
author-avatar
mobiledu2502889793
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有