搭建git私服
来源:互联网 发布:pc端口 命令 编辑:程序博客网 时间:2024/06/06 01:37
下面我们以centos系统为例搭建一个git私服:
1.安装git
yum install -y git
2.选择一个文件夹,将其初始化成一个中心远程仓库
git init --bare learngit.git
我这里的位置是:/usr/local/src/git,文件夹位置可自行选择
3.创建一个用户,并授权
adduser gitchown -R git:git learngit.git//-R是递归授权
4.在客户端所在的服务器上生成密钥(这样就不需要密码了)
cd /root/.sshssh-keygen -t rsa -C "13376157767@163.com"
5.打开git服务器上RSA认证
vi /etc/ssh/sshd_configRSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
6.将步骤4中生成的公钥添加到/home/git/.ssh/authorized_keys中即可
7.在客户端上选择一个文件夹,连接远程仓库
git clone git@192.168.56.101:/usr/local/src/git/learngit.git
ip和目录根据实际情况修改
8.禁止git用户的shell登陆
vi etc/passwd
将
git:x:1001:1001:,,,:/home/git:/bin/bash
改成
git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell
阅读全文
0 0
- Git-----搭建Git私服
- git之:搭建git私服
- 搭建git私服
- 搭建git私服
- [安全]Linux搭建GIT私服
- 搭建git
- Git搭建
- Git搭建
- 搭建git
- Git服务器 - 搭建git
- Git 搭建Git服务器
- git Git私服搭建
- Git之搭建Git服务器
- git教程 搭建GIT服务器
- 自定义Git - 搭建Git服务器
- GIT之git及git服务搭建
- git服务器搭建
- Git windows环境搭建
- Servlet的生命周期概述;设置Servlet的启动时加载
- [leetcode]#19. Remove Nth Node From End of List
- tomcat服务端查询url端口
- BZOJ1303 [CQOI2009]中位数图 差分+前缀和
- 实践线性模型对于大规模一类别协同过滤
- 搭建git私服
- [OpenGL] 初识OpenGL,计算机图形学
- 23种设计模式(四)
- TCP/IP 和 HTTP
- 安卓使用MediaPlayer自定义音频视频播放器
- 项目整理二:Echarts
- hibernate中懒加载禁用的方式
- vmware worstation退出简易安装步骤
- 归并的两种方法