Git 服务器 配置

服务器 Ubuntu 10.04


1、安装git和openssh
  sudo apt-get install git-core openssh-server openssh-client
 
2、新加用户git
  sudo useradd -m git
  sudo passwd git
 
3、初始化一下服务器的git用户
git config -global user.name "myname"
git config -global user.email "myname@server"

4、下载、安装python setuptools
sudo apt-get install python-setuptools 


5、下载、安装gitosis
cd ~/tmp
git clone git://eagain.net/gitosis.git 如果不成功,则用:git clone https://github.com/res0nat0r/gitosis.git
cd gitosis
sudo python setup.py install 

6、拷贝管理员公钥【管理员】
ssh-keygen -t rsa
scp .ssh/id_rsa.pub git@<server>:/tmp

7、服务器配置管理公钥
cd ~/tmp/gitosis
sudo chmod a+r /tmp/id_rsa.pub
sudo -H -u git gitosis-init < /tmp/id_rsa.pub
 
8、为git仓库 管理配置文件,增加权限
su
cd /home/git/repositories/gitosis-admin.git/
cd /home/repo/gitosis-admin.git/hooks/
sudo chmod 755 post-update
exit
 
9、在服务器上新建一个项目仓库
sudo mkdir /home/prj_git
sudo chown git:git /home/prj_git/
sudo chmod 700 /home/prj_git/

su - git
cd /home/prj_git
mkdir teamwork.git
cd teamwork.git
git init --bare
exit

10、管理gitosis的配置文件【管理员】
sudo mkdir ~/tmp
sudo chmod 777 ~/tmp
cd ~/tmp

git clone git@<server>:gitosis-admin.git
如果出现:
fatal: '~/gitosis-admin.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
改成:
sudo git clone git@<Server-IP>:/home/git/repositories/gitosis-admin.git

cd gitosis-admin/
该目录下的keydir目录是用来存放所有需要访问git服务器的用户的ssh公钥
各个用户按照前面提到的办法生成各自的ssh公钥文件后,把所有人的 ssh公钥文件都拿来,按名字命名一下,比如b.pub, lz.pub等,统统拷贝到keydir下

修改gitosis.conf文件,我的配置大致如 下:
[gitosis]
[group gitosis-admin]
writable = gitosis-admin
members = a@server usr@pc1
[group hello]
writable = teamwork
members = a@server b
[group hello_ro]
readonly = teamwork
members = lz

$ git add .
$ git commit -am “add teamweok prj and users”
$ git push origin master

11、初始化项目【管理员】
$ mkdir teamwork-ori
$ cd teamwork-ori/
$ git init
$ echo “/*add something*/” > hello
$ git add .
$ git commit -am “initial”
$ git remote add origin git@<Server-IP>:/home/prj_git/teamwork.git 
$ git push origin master

12、拉取代码库【管理员】
$ git clone git@<Server-IP>:/home/prj_git/teamwork.git
$ cd teamwork
$ vim hello
$ git add .
$ git commit -am “add”
$ git push origin master

$ exit

======================================================================================

使用ssh-keygen和ssh-copy-id三步实现SSH无密码登录

1、在本地机器上使用ssh-keygen产生公钥私钥对

ssh-keygen
2、用ssh-copy-id将公钥复制到远程机器中

ssh-copy-id -i ~/.ssh/id_rsa.pub lenovo@192.168.0.6

3、登录到远程机器不用输入密码
ssh lenovo@192.168.0.6
[Note: SSH did not ask for password.]


The TPS54331 is a 28-V, 3-A non-synchronous buck Integrated 80 mΩ High Side MOSFET Supports up to 3A Continuous Output Current converter that integrates a low Rds(on) high side MOSFET. To increase efficiency at light loads, a pulse skipping Eco-mode™ feature is automatically High Efficiency at Light Loads with a Pulse activated. Furthermore, the 1 A shutdown supply Skipping Eco-mode™ current allows the device to be used in battery Fixed 570kHz Switching Frequency Typical 1A Shutdown Quiescent Current powered applications. Current mode control with internal slope compensation simplifies the external compensation calculations and reduces component Adjustable Slow Start Limits Inrush Currents count while allowing the use of ceramic output Programmable UVLO Threshold Overvoltage Transient Protection capacitors. A resistor divider programs the hysterisis of the input under-voltage lockout. An overvoltage transient protection circuit limits voltage overshoots Cycle by Cycle Current Limit, Frequency Fold during startup and transient conditions. A cycle by Back and Thermal Shutdown Protection cycle current limit scheme, frequency fold back and Available in Easy-to-Use SOIC8 Package Supported by SwitcherPro™ Software Tool (http://focus.ti.com/docs/toolsw/folders/print/s witcherpro.html) For SWIFT™ Documentation, See the TI Website at www.ti.com/swift thermal shutdown protect the device and the load in the event of an overload condition. The TPS54331 is available in an 8-pin SOIC package that has been internally optimized to improve thermal performance.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值