php运行git得到“ssh Permission denied”

I'm trying to run git pull in a php script from a browser, but I got "sh: connect to host git.assembla.com port 22: Permission denied"

my php script:

<?php
$output=array();
$returnVar=0;
chdir("/var/www/html");
exec('git pull git@git.assembla.com:andrewadel.git master 2>&1', $output , $returnVar);
// exec('pwd', $output , $returnVar);
echo "<pre>
";
echo "return status: $returnVar

";
print_r($output);
echo "</pre>
";

when I manually run the script as "apache", everything is fine

bash-4.1$ whoami
apache
bash-4.1$ php gitsync.php
<pre>
return status: 0

Array
(
    [0] => From git.assembla.com:andrewadel
    [1] =>  * branch            master     -> FETCH_HEAD
    [2] => Already up-to-date.
)
</pre>

When I run it from a browser, it fails

http://103.7.164.33/gitsync.php?111

return status: 1

Array
(
    [0] => ssh: connect to host git.assembla.com port 22: Permission denied
    [1] => fatal: The remote end hung up unexpectedly
)

Thanks

dqiz20794
dqiz20794 然后,在php运行exec('ssh-vgit@assembla.com2>&1',$output,$returnVar);-----------------------返回状态:255数组([0]=>OpenSSH_5.3p1,OpenSSL1.0.0-fips2010年3月29日[1]=>不会分配伪终端,因为stdin不是终端。[2]=>debug1:读取配置数据/etc/ssh/ssh_config[3]=>debug1:应用*[4]=>debug1的选项:连接到assembla.com[64.250.188.41]端口22.[5]=>debug1:连接到地址64.250.188.41端口22:权限被拒绝[6]=>ssh:连接到主机assembla.com端口22:权限被拒绝)
接近 8 年之前 回复

4个回答

A lot of variables here... but I faced pretty much exact same behavior with a remote cgi script I was working on.

In my case the issue was related to SELinux on CentOS.

user@remoteserver:~$ getsebool -a | grep httpd

Showed:

...
httpd_can_network_connect --> off
...

Test Possible Fix(sudo or run as root):

user@remoteserver:~$ setsebool httpd_can_network_connect=1
//...then initiate your serverside script remotely

Permanent Fix(if above has proven effective):

user@remoteserver:~$ setsebool -P httpd_can_network_connect=1

-P option ensures subject SELinux boolean value is set to specified value as default on future reboots. See: man getsebool and man setsebool



Apache会将脚本作为“nobody”用户运行。 你的脚本依赖于私钥很可能存储在~apache / .ssh / id_rsa </ p>

失败的是git无法访问该密钥而无法对自己进行身份验证 git服务器。</ p>

解决方案是指定要使用的正确密钥,并使正在执行该脚本的用户可以访问该密钥。</ p>

阅读本文以了解如何指定密钥:</ p>

指定在执行带或不带Ruby的shell命令时使用的私有SSH密钥? </ p>

看一看 这里有一个以不同用户身份运行的方法:</ p>

https://serverfault.com/questions/226374/how-to-run-php-files-as-another-user-with-apache-and-fastcgi < / a> </ p>

我不建议作为nobody运行(从那时起,nobody用户就有了 访问您的私钥),或作为apache(从那时起,如果您的网站找到漏洞,您将增加可能造成的损害)。 因此,您应该创建一个具有最小权限的其他用户来读取您的私钥并执行git命令。 如果您只为此创建一个受限用户帐户并将密钥(公共/私有)放入〜/ .ssh </ p>
</ div>,则可能没有必要指定密钥。

展开原文

原文

Apache would run the script as the 'nobody' user. Your script relies on having the private key most likely stored at ~apache/.ssh/id_rsa

The failure is that git can't access that key and isn't able to authenticate itself against the git server.

The solution is to specify the correct key to use and make that key accessible to the user that is executing the script.

Read this for how to specify the key:

Specify private SSH-key to use when executing shell command with or without Ruby?

Take a look here for an approach to running as a different user:

https://serverfault.com/questions/226374/how-to-run-php-files-as-another-user-with-apache-and-fastcgi

I would not recommend running as nobody (since then the nobody user has access to your private key), or as apache (since then you are increasing the damage that could be done should an exploit be found for your site). Therefore you should create a different user with the minimal permissions to read your private key and execute the git command. It may not be necessary to specify the key if you just create a limited user account for this and put the keys (public/private) into ~/.ssh

dongmeng4742
dongmeng4742 我认为这实际上是真的。 我被错误与ssh连接拒绝错误的相似性所抛弃,但看起来存在某种沙箱以防止被利用的脚本进行外部连接。 猜测关键的事情将是第二件事出错。
接近 8 年之前 回复
dongxun3777
dongxun3777 我不认为这是根本原因,因为错误是ssh在打开连接时拒绝了权限。 该错误与验证失败无关。 因此,我认为这是PHP的一些其他权限问题或安全机制 - 请参阅我的答案。
接近 8 年之前 回复



您的网络服务器和PHP安装是否由Suhosin,安全模式,Apparmor或其他安全机制强制执行?</ p>

我建议您尝试使用 php-git 等PHP-Git绑定 操作。 该模块设计用于在PHP代码中使用Git。</ p>
</ div>

展开原文

原文

Is your webserver and PHP installation enforced by Suhosin, safe-mode, Apparmor or other security mechanisms?

And I recommend trying PHP-Git bindings like php-git if you're doing more operations. That module is designed for working with Git in PHP code.



这是权限问题吗? PHP脚本将作为最有可能的nobody用户运行,它可能没有运行git命令的权限。</ p>
</ div>

展开原文

原文

Is this a permissions issue? A PHP script would be run as the nobody user most likely, which may not have permissions to run the git command.

doushi2047
doushi2047 或者只是$ var = exec(“env”,$ output,&returnvar)
接近 8 年之前 回复
douzhuang1900
douzhuang1900 这取决于PHP脚本的执行方式。 你可以做一个ps aux | grep scriptName.php如果脚本正在运行。
接近 8 年之前 回复
douweibiao8471
douweibiao8471 对不起,我该如何查看php运行的用户?
接近 8 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
git执行ssh -v git@github.com一直是permission denied.

git执行ssh -v git@github.com一直是permission denied. OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips 1 Mar 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to github.com [192.30.253.113] port 22. debug1: Connection established. debug1: identity file /home/johnnyding/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/johnnyding/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1 debug1: Remote protocol version 2.0, remote software version libssh-0.7.0 debug1: no match: libssh-0.7.0 debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ssh-rsa debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /home/johnnyding/.ssh/known_hosts:1 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/johnnyding/.ssh/id_rsa debug1: Authentications that can continue: publickey debug1: Trying private key: /home/johnnyding/.ssh/id_dsa debug1: Trying private key: /home/johnnyding/.ssh/id_ecdsa debug1: Trying private key: /home/johnnyding/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey).

mac上用ssh Permission denied (publickey,password)

日志打印如下 OpenSSH_7.3p1, LibreSSL 2.4.1 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug1: Connecting to 10.211.55.18 [10.211.55.18] port 22. debug1: Connection established. debug1: identity file /Users/Sebastian/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/Sebastian/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.3 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000 debug1: Authenticating to 10.211.55.18:22 as 'Sebastian' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:v5nU1rPqA5E3j5krl8M2xnFco/14XvBqetfcP6qfTtE debug1: Host '10.211.55.18' is known and matches the ECDSA host key. debug1: Found key in /Users/Sebastian/.ssh/known_hosts:2 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/Sebastian/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: /Users/Sebastian/.ssh/id_dsa debug1: Trying private key: /Users/Sebastian/.ssh/id_ecdsa debug1: Trying private key: /Users/Sebastian/.ssh/id_ed25519 debug1: Next authentication method: password Sebastian@10.211.55.18's password: debug1: Authentications that can continue: publickey,password Permission denied, please try again. Sebastian@10.211.55.18's password: debug1: Authentications that can continue: publickey,password Permission denied, please try again. Sebastian@10.211.55.18's password: debug1: Authentications that can continue: publickey,password debug1: No more authentication methods to try. Permission denied (publickey,password). 在网上各种方法都试过啦 请问我该如何解决这一问题

git clone 时报错Permission denied (publickey)

下面是我生成ssh的全过程: 生成ssh: ![图片说明](https://img-ask.csdn.net/upload/201701/07/1483764440_654880.png) 测试与GitHub网站是否联通: ![图片说明](https://img-ask.csdn.net/upload/201701/07/1483764484_136481.png) 显示是可以联通成功的 使用ssh方式克隆项目: ![图片说明](https://img-ask.csdn.net/upload/201701/07/1483764527_953925.png) 报错: Warning: Permanently added the RSA host key for IP address '192.30.253.112' to t he list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 请问大师们,这是什么问题

ssh -T成功了,但是还是git clone 不了代码

我的项目git -T邮箱后, $ ssh -T git@gitee.com Hi xxx! You've successfully authenticated, but GITEE.COM does not provide shell access. 但是我git clone还是拉取不了代码,异常如下: Cloning into 'XXXX'... git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

windows 搭建SSH git服务器

公司用的是xshell 登录无服务器进行git代码管理,求大神教新手怎么搭建这样的一个服务器,只有一台电脑。 希望得到你的帮助。

windows7下git+copssh搭建服务器,git clone不了的问题

下面我来介绍一下我的操作具体流程,希望哪位好人能帮帮我这菜鸟 1、我一开始已经安装好了git+乌龟,后来因为公司练不了外网我师父叫我本地搞个服务器玩玩 所以我就上网找了copssh+git的方案来搭建git本地服务器,接下来我安装了copssh,一路下来没有改什么东西 2、启动copssh控制面板,按照网上教程add了一个新用户也就是一开始安装时的那个用户SvcCOPSSH。 3、我把服务器上的key添加到了copssh用户也是就SvcCOPSSH里的Authorized_keys这个文件里, 好了,这里出现了第一个问题,当我把需要输入用户密码打上勾时,每次ssh连接都提示:Could not create directory ‘ /home/hwx/.ssh’ The authenticity of host ‘ 10.188.**.**(10.188.**.**)’can't be established. ECDSA key fingerprint is **********************. Are you sure you want to continue connecting(yes/no)? yes Failed to add the host to the list of known hosts(/home/hwx/.ssh/konwn_hosts). 然后让你输入密码。 当我取消每次登入都要输入密码时,同上,但是不要求输入密码直接提示: Permission denied(publickey,keyboard-interactive). 4、好了上面的问题我先不管了打上输入密码的勾继续下一步,我在本地打开copssh自带了bash控制台ssh连接上了SvcCOPSSH用户服务器,然后我创建了一个文件夹serverrepo1,cd serverrepo1文件,然后git,提示找不到命令,所以我按照网上 教程git目录下的libexe/git-core文件里的git.exe、git-upload-pack、git-upload-archive、git-receive-pack和bin目录里的libiconv-2.dll(我发现git根目录下并没有找到这些文件后来网上说是在ming64/ming32文件夹下,一找还真有,然后就把他们都复制到了ICW下的bin里,现在第二个问题来了:当我ssh连接后在serverrepo1文件里git init 时提示: /usr/bin/git.exe:error while loading shared libraries:?:cannot open shared object file:No such file.... 然后我安装网上教程更改了ICW中.bashrc和profile这两个文件在里面添加了相关的路径: .bashrc: gitpath='/cygdrive/C/Program Files/Git/mingw64/bin' gitcorepath='cygdrive/C/Program Files/Git/mingw64/libexec/git-core' PATH=${gitpath}:${gitcorepath}:${PATH} profile: gitpath='/cygdrive/C/Program Files/Git/mingw64/bin' gitcorepath='cygdrive/C/Program Files/Git/mingw64/libexec/git-core' export PATH="/bin:$syspath:$gitpath:$gitcorepath:$winpath" 然后再试了一次已经可以了但是又提示: warning: templates not found C:\Program Filess(X86)\ICW/share/git/core/templates 然后又按照网上的人说把git中的share文件夹复制过来我照做了,结果是真的不提示了,而且也可以git init了,后来设置了一下git的email和name就可以add 和commit了,好了到这我已经开始兴奋了,哈哈终于可以传东西了,然后我在本机也就是服务器上(但不是用SvcCOPSSH这个用户登录的)用git bash 试着ssh服务器结果能连上 然后我就进行下一步了也是搞了我一个星期还没整出来的问题: $git clone SvcCOPSSH@10.188.**.**:serverrepo1 Cloning into 'serverrepo1'... SvcCOPSSH@10.188.**.**'s password: fatal:Could not read from remote repository. Please make sure you have the correct access rights and the repositort exists. 泪奔。。。 其中有几点想不明白为什么我ssh上SvcCOPSSH这的用户是他的工作目录是在ICW根 目录下的var目录里,而当我ssh另一个用户Administrtor用户时,他的工作目录却是在home/administrator目录下,到底哪一个是对的,还是都是对的? 说明:1、端口22已经打开,为此我还特定设置了规则 2、我的电脑处于公司内网,访问外网有限制

第一次使用git,无法连接github

我按照网上的教程一步步做的,结果检验是否连接上github时,用 $ ssh git@github.com命令 出现 socket: Socket operation on non-socket ssh: connect to host github.com port 22: Socket operation on non-socket ![图片说明](https://img-ask.csdn.net/upload/201511/28/1448703681_792541.png)

root用户可以git clone,但普通用户就不能git clone

ubuntu 14 LTS OS 按照网上的教程,ssh-keygen后,复制id_rsa.pub内的内容到github的ssh key中 并使用ssh -T git@github.com没问题。 然后使用命令 eval "$(ssh-agent)"打开agent 添加私钥ssh-add ~/.ssh/id_rsa 但使用git clone git@github.com/username/test.git 却失败,显示permission denied(publickey) fatal: Could not read from remote repository Please make sure you have the correct access rights. 但发现如果几点奇怪的地方: 使用http地址来git clone没问题 也使用命令测试 ssh-add -l能看到密钥 也使用命令ssh -v git@github.com也能看到密钥队。 最奇怪的是,我把用户换成root用户,执行完全相同的步骤,使用ssh协议的git clone却完全没问题。求解答。

git将本地仓库链接到远程仓库,死活连不上是怎么回事

毕彦青@LAPTOP-A1SM481U MINGW64 /myCode $ git init C:/Program Files/Git/myCode/.git: Permission denied 毕彦青@LAPTOP-A1SM481U MINGW64 /myCode $ ssh -T git@github.com Hi BgBi! You've successfully authenticated, but GitHub does not provide shell ac cess. 毕彦青@LAPTOP-A1SM481U MINGW64 /myCode $ cd C:\Program Files\Git bash: cd: too many arguments 毕彦青@LAPTOP-A1SM481U MINGW64 /myCode $ cd C:\Program" "Files 毕彦青@LAPTOP-A1SM481U MINGW64 /c/Program Files $ cd Git 毕彦青@LAPTOP-A1SM481U MINGW64 /c/Program Files/Git $ cd MyProject 毕彦青@LAPTOP-A1SM481U MINGW64 /c/Program Files/Git/MyProject $ git init C:/Program Files/Git/MyProject/.git: Permission denied 毕彦青@LAPTOP-A1SM481U MINGW64 /c/Program Files/Git/MyProject $ ssh -T git@github.com Hi BgBi! You've successfully authenticated, but GitHub does not provide shell ac cess.

git自己搭建的server。用linux可以git clone , win10 不能git clone

我用自己电脑搭建好了git服务器,使用手机Termux和virtualbox中的kali_linux都可以git clone 。 认证使用的是密钥认证。 win10中有加入ssh-add 密钥,也添加密钥成功,但就是最后一步git clone 时提示权限不足。错误如下: ``` ** git clone git@xxx.xxx.xxx.xxx:stores/test.git** Cloning into 'test'... git@xxx.xxx.xxx.xxx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` xxx.xxx.xxx.xxx是我自己主机ip。 还有一个问题是:git clone 能不能指定端口,网上的 git clone git://name@host:port/direcotory/test.git 是不能用的。

【git】配置了公钥还是不能clone github的项目,提示没有公钥

Cloning into 'ebatis'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. github公钥已配, ssh -T git@github.com执行正常 Hi hellojamie! You've successfully authenticated, but GitHub does not provide shell access. 系统windows10 求解释

ubuntu git 无法clone

Permission denied (publickey,keyboard-interactive). fatal: The remote end hung up unexpectedly git 不能clone 用的ubuntu 12.04系统

git push -u origin master 报错这么解决

$ git push -u origin master Warning: Permanently added the ECDSA host key for IP address '120.55.226.24' to the list of known hosts. Access denied exec request failed on channel 0 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

主机密钥不匹配

<div class="post-text" itemprop="text"> <p>I am trying to connect to a remote server using Go. This is what I am using: (<a href="https://stackoverflow.com/questions/45441735/ssh-handshake-complains-about-missing-host-key">SSH Handshake complains about missing host key</a>)</p> <pre><code> key, err := ioutil.ReadFile("/Users/pankaj/.ssh/id_rsa") if err != nil { log.Fatalf("unable to read private key: %v", err) } // Create the Signer for this private key. signer, err := ssh.ParsePrivateKey(key) if err != nil { log.Fatalf("unable to parse private key: %v", err) } hostKeyCallback, err := knownhosts.New("/Users/pankaj/.ssh/known_hosts") if err != nil { log.Fatal(err) } sshConfig := &amp;ssh.ClientConfig{ User: "pankaj", Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, HostKeyCallback: hostKeyCallback, } conn, err := ssh.Dial("tcp", "dev.letsreap.com:22", sshConfig) if err != nil { log.Fatalf("unable to connect: %v", err) } </code></pre> <p>However on ssh.Dial I am getting:</p> <pre><code>ssh: handshake failed: knownhosts: key mismatch </code></pre> <p>I have verified that I can connect to the remote server from the command line. Also I can connect successfully if I use ssh.InsecureIgnoreHostKey(). What am I missing?</p> </div>

Docker Alpine Golang Go进入coding.net私有仓库错误

<div class="post-text" itemprop="text"> <p>I created the private repository using the coding.net.<br> I use docker images <strong>alpine</strong> and <strong>centos</strong>.<br> I can go get <code>git.coding.net/alphayan/orionv2.git successful</code> from docker-centos, but I can't go get <code>git.coding.net/alphayan/test.git</code> from docker-alpine.It returns an error stating: </p> <pre><code>/go/src # go get -u -v git.coding.net/alphayan/test.git # cd .; git ls-remote https://git.coding.net/alphayan/test fatal: could not read Username for 'https://git.coding.net': terminal prompts disabled # cd .; git ls-remote git+ssh://git.coding.net/alphayan/test Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. # cd .; git ls-remote ssh://git.coding.net/alphayan/test Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. package git.coding.net/alphayan/test.git: cannot download, git.coding.net/alphayan/test uses insecure protocol </code></pre> <p>From centos it let me use the username and password:</p> <pre><code>[root@83fc8067fc95 /]# go get -u -v git.coding.net/alphayan/test.git Username for 'https://git.coding.net': </code></pre> <p>finally, I find it caused by the git's version, the centos with git 1.8.3 and the alpine with git 2.11.0.<br> then I change the centos git's version with 2.11.0, becomes the same wrong with alpine. I think I can modify golang or git source file solve this problem, could someone help me? thinks~!</p> </div>

Git POST webhook shell_exec

<div class="post-text" itemprop="text"> <p>I have a script running the following shell_exec cmd in PHP.</p> <pre><code>echo shell_exec('cd /var/www/Library/Laravel/ ; git pull bitbucket master ; 2&gt;&amp;1'); </code></pre> <p>This is being called by a webhook service and all I wanted to do is just cut out having to pull in this dev environment everytime we push.</p> <p>However, I do not get any output errors or anything when this route is called. Can anyone suggest why this might be?</p> <p>I get this echoing from the error_log -&gt; </p> <pre><code>error: cannot open .git/FETCH_HEAD: Permission denied </code></pre> <p>I added the apache user to git and now I get the following error</p> <pre><code>Could not create directory '/var/www/.ssh'. Host key verification failed. fatal: The remote end hung up unexpectedly </code></pre> </div>

vs2013 git 团队资源管理器如何使用?

有没有朋友用vs2013 中git 来团队开发?拉取的时候说我有未提交 不能拉取,那我就先提交吧,结果说我有东西未拉取 不能提交...到底要怎么弄... 另外分支到底要如何使用? 新手开发,问题有点多,请多包涵...

由于shell脚本权限,Gitlab webhooks无法正常工作

<div class="post-text" itemprop="text"> <p>Using laravel 5.6. I'm trying to set up a webhook on gitlab, to make a <code>git pull</code> on push events. I've created a post route, added controller and method, that launches a shell script:</p> <pre><code>use Symfony\Component\Process\Process; class WebhookController extends Controller { public function handle(Request $request) { $root_path = base_path(); $process = Process::fromShellCommandline('cd ' . $root_path . '; ./deploy.sh'); $process-&gt;run(function($type, $buffer) { echo $buffer; }); } } </code></pre> <p>Shell script itself contains just a one line:</p> <pre><code>#!/bin/sh git pull </code></pre> <p>But in gitlab's request details, i see an error after a push:</p> <pre><code>error: cannot open .git/FETCH_HEAD: Permission denied </code></pre> <p>I already <code>chmod 777 deploy.sh</code>, but i guess it tries to launch that script from different user? If i launch the script from my user, it just works (i'm using ssh key without a password).</p> <p><strong>UPDATE</strong></p> <p>I did <code>sudo chown -R $USER:www-data .</code> - now it doesn't show an error with permissions, except the one:</p> <pre><code>Could not create directory '/var/www/.ssh'. Host key verification failed. fatal: Could not read from remote repository. </code></pre> <p>It's trying to make a <code>git pull</code> using www-data user (i checked with whoami), so it doesn't have a right ssh key, how can i switch to my USERNAME?</p> </div>

如何与私有github企业服务器一起使用go get?

<div class="post-text" itemprop="text"> <p>We use github enterprise server over a VPN.</p> <p>If I type:</p> <pre><code>go get privateserver.com/path/to/myproject.git </code></pre> <p>I get this result: </p> <pre><code>package privateserver.com/path/to/myproject.git: cannot download, privateserver.com/path/to/myproject uses insecure protocol </code></pre> <p>Or removing the .git suffix I get:</p> <pre><code>package privateserver.com/path/to/myproject: unrecognized import path "privateserver.com/path/to/myproject" (parse https://privateserver.com/path/to/myproject?go-get=1: no go-import meta tags ()) </code></pre> <p>It seems there are many similar questions on google searches but have found no answers that actually work. </p> <p>What I really want to end up with is automation of docker builds. Inside my docker file I require a go get. But I can't store the credentials inside the docker file.</p> <p>Note: --insecure doesn't work. See bottom of question.</p> <hr> <p>Just tried go get with -insecure -v options. I get the following output:</p> <pre><code>matthewh@xen:~/go/src/$ go get -insecure -v privateserver.com/path/to/myproject.git # cd .; git ls-remote git://privateserver.com/path/to/myproject fatal: remote error: GitHub private mode is enabled. Git protocol is disabled. Use authenticated http or ssh access instead. # cd .; git ls-remote https://privateserver.com/path/to/myproject fatal: could not read Username for 'https://privateserver.com': terminal prompts disabled # cd .; git ls-remote http://privateserver.com/path/to/myproject fatal: could not read Username for 'https://privateserver.com': terminal prompts disabled # cd .; git ls-remote git+ssh://privateserver.com/path/to/myproject Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. # cd .; git ls-remote ssh://privateserver.com/path/to/myproject Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. privateserver.com/path/to/myproject.git (download) # cd .; git clone privateserver.com/path/to/myproject /home/matthewh/go/src/privateserver.com/path/to/myproject.git fatal: repository 'privateserver.com/path/to/myproject' does not exist package privateserver.com/path/to/myproject.git: exit status 128 </code></pre> </div>

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

立方体线框模型透视投影 (计算机图形学实验)

计算机图形学实验 立方体线框模型透视投影 的可执行文件,亲测可运行,若需报告可以联系我,期待和各位交流

2019 AI开发者大会

2019 AI开发者大会

组成原理课程设计(实现机器数的真值还原等功能)

实现机器数的真值还原(定点小数)、定点小数的单符号位补码加减运算、定点小数的补码乘法运算和浮点数的加减运算。

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

软件测试2小时入门

软件测试2小时入门

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

计算机图形学-球的光照模型课程设计

计算机图形学-球的光照模型,有代码完美运行,有课程设计书

Linux常用命令大全(非常全!!!)

Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错。我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短小但却功能强大。我将我了解到的命令列举一下,仅供大家参考: 系统信息 arch 显示机器的处理器架构 uname -m 显示机器的处理器架构 uname -r 显示正在使用的内核版本 d...

因为看了这些书,我大二就拿了华为Offer

四年了,四年,你知道大学这四年我怎么过的么?

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

fakeLocation13.5.1.zip

fakeLocation13.5.1 虚拟定位 ios13.5.1的最新驱动下载,iPhone/iPad免越狱虚拟定位工具Location-cleaned驱动已更新

UnityLicence

UnityLicence

Python可以这样学(第一季:Python内功修炼)

Python可以这样学(第一季:Python内功修炼)

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

土豆浏览器

土豆浏览器可以用来看各种搞笑、电影、电视剧视频

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

php+mysql学生成绩管理系统

学生成绩管理系统,分三个模块:学生,教师和管理员。 管理员模块:负责学生、老师信息的增删改;发布课程信息的增删改,以便让学生选课;审核老师提交的学生成绩并且打印成绩存档;按照课号查询每个课号的学生成绩

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

推荐24个国外黄色网站欣赏

在中国清朝,明黄色的衣服只有皇子才有资格穿,慢慢的黄色在中国就成了高贵的颜色。在人们的色彩印象中,黄色也表现为暂停。所以当你的网页设计采用黄色的时候,会让人们在你的网页前停留。 黄色,就像橙色和红色,黄色也是一个暖色。它有大自然、阳光、春天的涵义,而且通常被认为是一个快乐和有希望的色彩。黄色是所有色相中最能发光的颜色,给人轻快,透明,辉煌,充满希望的色彩印象。 黄色是一个高可见的色...

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

C++语言基础视频教程

C++语言基础视频教程

玩转Python-Python3基础入门

玩转Python-Python3基础入门

相关热词 c# 局部 截图 页面 c#实现简单的文件管理器 c# where c# 取文件夹路径 c# 对比 当天 c# fir 滤波器 c# 和站 队列 c# txt 去空格 c#移除其他类事件 c# 自动截屏
立即提问