分区:
/ 30G (ext4)
/swap 4G (swap)
/boot 10G (ext4)
/home left (ext4)
登陆用户”work”(Administrator)
1. System update
更新系统,避免搭建过程中可能出现的系统软件引发的问题。
work@work:~$ sudo apt-get update
work@work:~$ sudo apt-get upgrade
2. Setup openssh
work@work:~$ sudo apt-get install openssh-server openssh-client
3. Modify ssh config file
ssh(secure shell) config file:/etc/ssh/sshd_conf
A. backup and modify ssh_conf
work@work:~$ sudo cp /etc/ssh/sshd_conf /etc/ssh/sshd_conf.bk
work@work:~$ sudo gedit /etc/ssh/sshd_conf
content modify like this:
Port 22 #ssh服务的登录端口
PermitRootLogin no #禁止root用户登录
StrictModes yes #检查密钥的用户和权限是否正确
RSAAuthentication yes #启用RSA认证
PubkeyAuthentication yes #启用公钥认证
Password Authentication no #禁止密码认证
ServerKeyBits 1024 #将serverkey强度改为1024比特
PermitEmptyPasswords no #禁止空密码登录
B. restart ssh
work@work:~$ service ssh restart
PS: 旧版ubuntu:sudo /etc/init.d/ssh restart 已经无法用了
4. Setup git-core gitk git-gui
work@work:~$ sudo apt-get install git-core gitk git-gui
5. Setup gitosis
When manage user/project authority, you may need Gitosis or Gitolite. Here we use gitosis.
A. mkdir to save gitosis setup file
work@work:~$ mkdir gitosis-setup
work@work:~$ cd gitosis-setup
B. clone gitosis setup file to target folder
work@work:/gitosis-setup$ git clone git://eagain.net/gitosis
work@work:/gitosis-setup$ cd gitosis
work@work:/gitosis-setup$ sudo apt-get install python-setuptools
work@work:/gitosis-setup$ sudo python setup.py install
6. Add new user
We need to add new user to manager git仓库and gitosis-admin.
new user named : git
key : git
work@work:~$ sudo useradd –m git
work@work:~$ sudo passwd git