2016-08-03 1 views
0

私たちはsymfonyのプロジェクトのために、公開ソースの横にssh経由でアクセス可能な独自のgitlabサーバのプライベートリポジトリを使用します。ubuntu:作者と私用リポジトリのインストール方法

私のローカルのubuntuマシンにこの専用リポジトリだけをクローンしても問題ありません。 私は、エラーメッセージ、次の取得このリポジトリを含んプロジェクトに

$ sudo composer install 

使用する場合:私はこれを実行する場合

[RuntimeException] 
Failed to execute git clone --mirror 'g[email protected]:myprivaterepo.git' '/home/aliebermann/.composer/cache/vcs/git-gitlab.con.example.com-myprivaterepo.git/' 
Cloning into bare repository '/home/myuser/.composer/cache/vcs/git-gitlab.con.example.com-myprivaterepo.git'... 
    __________________________________________________________________ 
    |                 | 
    | This system is for the use of authorized users only. Usage of | 
    | this system may be monitored and recorded by system personnel. | 
    |                 | 
    | Anyone using this system expressly consents to such monitoring | 
    | and is advised that if such monitoring reveals possible   | 
    | evidence of criminal activity, system personnel may provide the | 
    | evidence from such monitoring to law enforcement officials.  | 
    |__________________________________________________________________| 
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. 

私はSSHキーが私の個人の家に位置しているためであると推定し、 sudoとして呼び出されません。 他のLinuxシステムのように "su"を単純に使用することはできないので、私はこれをどのように修正するのか迷っています。

sudoを使わないで作者を実行させることはできません。

次私は/root/.sshするすべての私のSSHキーをコピーしたが、彼らはパスワードで保護されて以来、私は次の問題に実行します。

$ sudo ssh-add -k 
[sudo] Password for myuser: 
Could not open a connection to your authentication agent. 
+0

私はroot権限のないmyuserとして実行しています。これは私の問題を解決しますが、問題は解決しません。 –

答えて

0

rootのSSHキーを作成し、それへのアクセスを許可します。

これを行うには、実際にはsuは必要ありません。あなたが本当にしたい場合しかし、あなたはrootになることができます:

sudo su - 

更新

は、だから私はあなたがrootに、ユーザーのキーをコピーご覧ください。ここまでは順調ですね。

$ sudo ssh-add -k 
[sudo] Password for myuser: 
Could not open a connection to your authentication agent. 

rootのために実行中の認証エージェントが存在しないようです。 最初に起動する必要があります。あなたはrootcomposer installを行うことができ、この後

# become root; will ask for user's password 
sudo su - 

# start ssh-agent 
eval $(ssh-agent) 

# add private key to agent; will ask for passphrase 
ssh-add 

: はここでそれを行うための一つの方法があります。

+0

'root'の認証エージェントを起動しましたか? 'root'のキーを作成しましたか?そうではないようです。おそらく 'sudo su -'で' root'になった後、通常の手順に従って鍵を作成して認証するのがもっともです。 – janos

+0

私たち[チャットでこのディスカッションを続行](http://chat.stackoverflow.com/rooms/120082/discussion-between-janos-and-calamity-jane)。 – janos

+0

私はあなたの質問のあなたのコメントと更新の新しい情報に照らして私の答えを修正しました。さらなる質問がある場合は、残りのチャットを簡単に並べ替えるのが簡単になります。以前のコメントのリンクをクリックしてください。 – janos

0

また、サーバーのsudoersファイルに

Defaults  env_keep+=SSH_AUTH_SOCK 

を追加し、サーバーに接続するとき、あなたのsshコマンドラインに-Aを追加することがあります。リポジトリに関連付けられたローカルマシンのsshエージェントに正しい鍵があると仮定すると、

sudo composer install 

はちょうどうまくいくはずです。

関連する問題