我工作的地方最近离开的开发商,我一直在负责回收所有的按键等Git的部署脚本失败,但SSH并不
我们用到位桶为我们的源代码控制和这个特别的开发人员在我们的一台服务器上运行“pull脚本”,这会将我们的开发分支中的任何内容拖放到该站点的测试版本上。在我们删除了他的Atlassian帐户之后,它使用了与此密钥一起使用的SSH密钥。之后,我生成了新的密钥,将公众上传到我的Atlassian帐户,并将私人服务器放置在服务器上,非常好。
然而,他的部署脚本返回Permission denied (publickey).
当我尝试$ ssh [email protected]
我得到如下:
PTY allocation request failed on channel 0
logged in as ChocolateDinosaur.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
Connection to bitbucket.org closed.
这似乎工作? (请原谅我的无知,如果不是这种情况)
部署脚本如下:
<?php
$commands = array(
'echo $PWD',
'whoami',
'git pull',
'git status',
// 'git submodule sync',
// 'git submodule update',
// 'git submodule status',
);
$output = '';
foreach($commands AS $command){
$tmp = shell_exec($command);
$output .= "<span style=\"color: #6BE234;\">\$</span> <span style=\"color: #729FCF;\">{$command}\n</span>";
$output .= htmlentities(trim($tmp)) . "\n";
}
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>GIT DEPLOYMENT SCRIPT</title>
</head>
<body style="background-color: #000000; color: #FFFFFF; font-weight: bold; padding: 0 10px;">
<pre>
<?=$output?>
</pre>
</body>
</html>
源代码控制肯定不是我的强项,我认为这是一个必要的恶,我假设脚本失败的原因是我们的服务器上的git
要么指向github而不是bitbucket,要么仍然试图使用一些以前的开发人员凭据?
我已经改变了git config --global user.name
和git config --global user.email
来试图解决这个问题。
任何建议将不胜感激。
您是否正在使用运行PHP脚本的相同用户测试SSH命令? – zigarn
啊也许不是!我想这个脚本是由www-data – Aphire
运行的所以我认为你需要启用SSH的www数据用户 – zigarn