拒絕(公鑰)我盡我的遠程混帳服務器權限上推到遠程混帳服務器
cd /var/www/vhost/example.com
sudo git init
sudo git remote add origin ssh://[email protected]:30000/home/git/repositories/example.git
sudo git add .
sudo git commit -a -m "Create empty example.com dir"
sudo git push origin master:refs/heads/master
我的ssh配置上創建新的倉庫:
Host 111.111.111.111
User git
Port 30000
IdentityFile ~/.ssh/id_rsa
我的gitosis-admin.conf中
[gitosis]
[group gitosis-admin]
members = [email protected]
writable = gitosis-admin
[group example-com]
members = [email protected] [email protected]
writable = example-com
得到錯誤
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我可以做
ssh [email protected]
沒有問題,但不能做俯臥撐。我做錯了什麼?我也看過類似的前一個問題GitHub: Permission denied (publickey). fatal: The remote end hung up unexpectedly,但我不使用github。
更新:好吧,我想問題在sudo。
此命令的完整whitout某種錯誤:
git push origin master:refs/heads/master
此命令:
sudo git push origin master:refs/heads/master
完整的錯誤:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
遠程URL應該是'ssh://[email protected]:30000/example.git',如果它像gitolite nowaday一樣遠程工作。順便說一句。你應該切換到[gitolite](http://gitolite.com/gitolite/),它是gitosis的繼任者。 – poke 2013-03-12 17:40:37
無論如何,我採取錯誤權限被拒絕(publickey)。致命:遠端意外掛斷。 – user2112300 2013-03-12 17:52:14
當你正常ssh進入它,你有殼嗎?如果是,則需要爲存儲庫和標準ssh訪問使用不同的公鑰。 – poke 2013-03-12 18:24:24