gitlab/github 与walle配合搭建
st=>start: Git/SVN Serve
op1=>operation: 宿主机
op2=>operation: 目标机
st(right)->op1(right)->op2
宿主机:walle服务安装所在的机器
目标机:代码要分发到的机群
由于php-fpm
或者php
进程通常是以www
或者nobody
用户执行,
而www
或nobody
用户通常是无法登录系统的,因此需要先将用户转为可登录状态
$ vim /etc/passwd
$ su - nobody # 一定要加-,不加-直接 su nobody 不会切换bash目录.
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nobody/.ssh/id_rsa):
Created directory '/home/nobody/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/nobody/.ssh/id_rsa.
Your public key has been saved in /home/nobody/.ssh/id_rsa.pub.
The key fingerprint is:
70:14:00:df:58:e1:2c:19:69:ef:95:2d:bb:0f:95:d0 nobody@iZwz90p9hndj8jd5c22f8xZ
The key's randomart image is:
+--[ RSA 2048]----+
| ..oo=o |
| .oX . |
| .*.= .oE |
| +. +... |
| .S. oo |
| . .. |
| .. |
| .. |
| .. |
+-----------------+
$cat ./ssh/id_rsa.pub
复制公钥中的内容,到gitlab
或者github
中,添加后,可执行
$ ssh -T git@github.com
$ #在提示你输入<yes/no>?的时候,输入 yes (默认是no) 会有更详细的错误信息
$ Hi yourname! You've successfully authenticated, but GitHub does not provide shell access.
如果看到以信息说明已经添加成功,接下来,再把nobody
用户改为不允许登录则可.
如何配置一个环境