免费git+ubuntu+ssh服务器搭建过程
git服务器搭建过程
参考网上资料搭建git服务器过程记录 如下:
基本需求
硬件需求:一台Ubuntu或者debian电脑(虚拟机),能通过网络访问到。
软件需求:git-core, gitosis, openssh-server, openssh-client, Apache2(Gitweb)
安装配置git服务器 1. 安装git和openssh:
a@server:~$ sudo apt-get install git-core openssh-server openssh-client
新加用户git, 该用户将作为所有代码仓库和用户权限的管理者:
a@server:~$ sudo useradd -m git
a@server:~$ sudo passwd git
建立一个git仓库的存储点:
a@server:~$ sudo mkdir /home/repo
让除了git以外的用户对此目录无任何权限:
a@server:~$ sudo chown git:git /home/repo
a@server:~$ sudo chmod 700 /home/repo
2. 安装配置gitosis
初始化一下的git用户,这一步其实是为了安装gitosis做准备。在任何一台机器上使用git,第一次最好要初始化一下:
a@server:~$ git config --global user.name "myname"
a@server:~$ git config --global user.email "myname@server"
安装一下python的setup tool, 这个也是为了gitosis做准备:
a@server:~$ sudo apt-get install python-setuptools
获得gitosis包:
a@server:~$ cd /tmp
a@server:/tmp$ git clone git://eagain.net/gitosis.git
a@server:/tmp$ cd gitosis
a@server:/tmp/gitosis$ sudo python setup.py install
切换到git用户下:
a@server:/tmp/gitosis$ su git
默认状态下,gitosis会将git仓库放在 git用户的home下,所以我们做一个链接到/home/repo
$ ln -s /home/repo /home/git/repositories
再次返回到默认用户
$ exit
如果你将作为git服务器的管理员,那么在你的电脑上(另一台pc)生成ssh公钥:
usr@pc1:~$ ssh-keygen -t rsa
将公钥拷贝到服务器的/tmp下:
usr@pc1:~$ scp .ssh/id_rsa.pub git@<server>:/tmp
回到git服务器上
a@server:/tmp/gitosis$ sudo chmod a+r /tmp/id_rsa.pub
让gitosis运行起来:
a@server:/tmp/gitosis$ sudo -H -u git gitosis-init < /tmp/id_rsa.pub
Initialized empty Git repository in /home/repo/gitosis-admin.git/
Reinitialized existing Git repository in /home/repo/gitosis-admin.git/
gitosis的有趣之处在于,它通过一个git仓库来管理配置文件,仓库就放在了/home/repo/gitosis-admin.git。
我们需要为一个文件加上可执行权限:
a@server:/home/git$ sudo passwd root
a@server:/home/git$ su
root@server:/home/git# cd repositories
root@server:/home/git/repositories# cd gitosis-admin.git/
root@server:/home/git/repositories/gitosis-admin.git# sudo chmod 755 /home/repo/gitosis-admin.git/hooks/post-update
root@server:/home/git/repositories/gitosis-admin.git# exit
3. 在服务器上新建一个测试项目仓库
我建了一个叫“teamwork”的仓库。
切换到git用户:
a@server:/home/git$ su git
$ cd ~/repositories
$ mkdir teamwork.git
$ cd teamwork.git
$ git init --bare
$ exit
但是,到目前为止,这只是一个空仓库,空仓库是不能clone下来的
git+ubuntu+ssh服务器搭建过程_IT/计算机_专业资料。使用gitosis管理git权限git 服务器搭建过程 参考网上资料搭建 git 服务器 服务器过程记录 如下: 硬件需求 ...
Ubuntu+vsftpd 搭建简单 FTP 服务器来源:开发界 http://www.kaifajie.cn 前端时间公司服务器搬迁, 需要在一台新的服务器上配置 FTP 服务。 这台服务器装的是...
新手搭建网站服务器(Ubuntu+LAMP)_IT/计算机_专业...Vmware 软件可以从 这里免费下载. 安装 Ubuntu 6....默认安装过程结束后,唯一呈现在你面前的将是一个 ...
ubuntu下架设svn服务器及在windows建立svn+ssh客户端_IT/计算机_专业资料。... svn+ssh方式svn服务器和... 4页 免费 ubuntu下SVN服务器安装配... 3页 ...
git commit -a -m "initial import" git push origin master:refs/heads/... ubuntu搭建svn服务器 2页 免费喜欢此文档的还喜欢 免费git+ubuntu+ssh服务.....
安装 ssh-server 检查是否已经安装了 ssh 服务:ps –s grep ssh; 如果... Ubuntu Git服务器搭建 2页 1下载券 Ubuntu下Git使用 暂无评价 6页 免费 04...
15页 免费 Ubuntu 10.04下的tftp服... 2页 1下载券 ubuntu 10.04下的TFTP服... 2页 1下载券 Ubuntu下git服务器的搭建... 3页 3下载券 ubuntu下ssh...
Ubuntu下用Gitosis搭建GIT代码服务器及Eclipse下的Git操作_计算机硬件及网络_IT/... 免费git+ubuntu+ssh服务... 4页 免费 Eclipse上GIT插件EGIT使... 30页 ...
Ubuntu+Sendmail+Dovecot+Openwebmail搭建邮件服务...ssh.tw mail.ssh.tw 接收发往ssh.tw域和mail.... Ubuntu配置DNS服务器--b... 14页 免费...
在ubuntu上搭建web服务器_互联网_IT/计算机_专业资料。在 ubuntu 中构建 web... Ubuntu Server Web服务器... 8页 免费 Ubuntu搭建SSH_WEB环境 2页 1下载券...
热门文档