博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Phabricator 配置ssh访问代码仓库
阅读量:7040 次
发布时间:2019-06-28

本文共 1480 字,大约阅读时间需要 4 分钟。

根据官方文档需要准备3个用户

www-user, daemon-user, vcs-user

本次配置计划使用两个用户

其中www-user和daemon-user使用既有用apache

www-user,daemon-user

php-fpm本身配置的帐号是apache

这里daemon-user也直接使用apache用户。

./bin/config set phd.user apache

设置vcs-user

计划使用git作为用户名

./bin/config set diffusion.ssh-user git

创建用户并设置

useradd gitusermod -p NP gitusermod -s /bin/sh git

配置sudo

执行命令 visudo
增加如下内容

git ALL=(apache) SETENV: NOPASSWD: /usr/bin/git-http-backend,/usr/bin/git,/usr/bin/git-upload-pack,/usr/bin/git-receive-pack,/usr/bin/svnserve,/usr/bin/svn

注意,如果存在

Defaults requiretty

则需要将它注释掉(在行首增加 # )

配置SSH

1.使用端口2222

./bin/config set diffusion.ssh-port 2222

2.创建配置文件

cp ./resources/sshd/phabricator-ssh-hook.sh /usr/libexec/phabricator-ssh-hook.shchmod 755 /usr/libexec/phabricator-ssh-hook.shcp ./resources/sshd/sshd_config.phabricator.example /etc/ssh/sshd_config.phabricator

编辑配置文件

vi /etc/ssh/sshd_config.phabricator

AuthorizedKeysCommand /usr/libexec/phabricator-ssh-hook.shAuthorizedKeysCommandUser gitAllowUsers git

vi /usr/libexec/phabricator-ssh-hook.sh

# NOTE: Replace this with the username that you expect users to connect with.VCSUSER="git"# NOTE: Replace this with the path to your Phabricator directory.ROOT="/opt/phabricator"

3.启动sshd

/usr/sbin/sshd -f /etc/ssh/sshd_config.phabricator

出现错误信息:
Could not load host key: /etc/ssh/ssh_host_dsa_key

解决方法:

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

一路回车即可

然后再次启动

重启phd daemon

./bin/phd restart

如果有权限问题,设置目录权限

chown -R apache. /var/tmp/phd

chown -R apache. /var/repo

转载地址:http://jdaal.baihongyu.com/

你可能感兴趣的文章
立澜光伏项目提交虚假材料被叫停发电
查看>>
微软SaaS应用拳头产品Dynamics 365售价被泄露
查看>>
中国好DC(数据中心)
查看>>
推动网络流量全面可视化 Gigamon在行动
查看>>
大数据时代继续教育深化发展的机遇与挑战分析
查看>>
黑客“纵横”全球金融系统 中国公司被盯上
查看>>
“光伏贷”推动分布式光伏进入百姓家
查看>>
探究电气设计系统中计算机的应用
查看>>
洛龙区:加快布局大数据产业
查看>>
看不见的"频谱"助力智慧城市建设
查看>>
软件测试文档写作——测试方案
查看>>
大数据的商业化:从数据、模型到业务逻辑
查看>>
Junit在MyEclipse上怎么用?
查看>>
能测试知多少--系统计数器与硬件分析
查看>>
颠覆传统 移动CRM成企业应用热点
查看>>
适合应用RFID的六大领域介绍
查看>>
《Web测试囧事》——2.6 时区不一致造成邮件发送异常
查看>>
需求管理是需求开发的基础
查看>>
干货:模板网站SEO优化技巧!
查看>>
CB Insights:2017年Q1网络安全领域共实现140宗投资
查看>>