# useradd -c ‘git version manage‘ -m -d /home/git -s /bin/bash git
# passwd git //为git用户添加密码
# su git 切换到git用户下
走到这一步跳到 第五步操作 完成之后调回到下一步
# gitosis-init < /tmp/id_rsa.pub
显示以下信息即表示成功
Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/
到目前为止Linux git服务器安装成功
第五步:回到我们的电脑 生成git密钥用户名
#ssh-keygen -t rsa //执行此命令时一路回车 看到看面的信息
/*
Generating public/private rsa key pair.
Enter file in which to save the key (路径/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in 路径/.ssh/id_rsa.
Your public key has been saved in 路径/.ssh/id_rsa.pub.
The key fingerprint is:
71:5e:81:48:41:91:af:4c:74:bf:da:d8:9c:a6:d4:e9 root@wlkj-tianxin-linux-server
*/
将生成的id_rsa.pub文件上传Linux git服务器的 /tmp/ 下 就是 第四步中的 gitosis-init < /tmp/id_rsa.pub 的文件
第五步完成