Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9136715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:59:22+00:00 2026-06-17T08:59:22+00:00

What went wrong I have a ubuntu 12.10 server. I installed Jenkins and Nginx

  • 0

What went wrong

I have a ubuntu 12.10 server.

I installed Jenkins and Nginx in the same server.

The /var/virtual where Nginx is supposed to server files from has a permission settings of www-data:www-data

The user jenkins is running Jenkins the software.

enter image description here

This is my target written in phing build.xml

<target name="gitclone">
        <echo msg="gitclone ${environment.branch} branch code to ${environment} environment" />

        <exec command="ssh -A ${host-used} 'git clone -b ${repository-uri} ${environment.branch} ${environment.sitedir}${build.time}'"
         outputProperty="result" escape="false"/>
        <echo msg="${result}" />

        <echo msg="update all the submodules after gitclone" />
        <exec dir="${environment.sitedir}${build.time}" command="ssh -A ${host-used} 'git submodule update --init --recursive'" outputProperty="result" escape="false" />
        <echo msg="${result}" />

    </target>

This is my console output from jenkins:

[echo] gitclone master branch code to production environment
[echo] Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
[echo] update all the submodules after gitclone
Execution of target "gitclone" failed for the following reason: /var/lib/jenkins/jobs/abc-master/workspace/build.xml:116:48: '/var/virtual/abc.com/2013_01_11_07_45_35' is not a valid directory

What I tried

I googled around and then I saw this github article on ssh agent forwarding.

This is what I tried.

I ssh into my server as jenkins.

Then I typed

ssh -T www-data@xxx.xx.xxx.xx

I was prompted for www-data@xxx.xx.xxx.xx password which I then gave. Note that xxx.xx.xxx.xx from now onwards refer to the ip address of the same server.

I successfully logged in as www-data, so I exited www-data@xxx.xx.xxx.xx. Now back in server as jenkins user.

Now I try

echo "$SSH_AUTH_SOCK"

I got nothing.

I went inside /var/lib/jenkins/.ssh/config and typed the following:

Host xxx.xx.xxx.xx
ForwardAgent yes
IdentityFile /var/lib/jenkins/.ssh/id_rsa
StrictHostkeyChecking no

Build Jenkins job again. Fail.

Then I thought maybe I need to set the authorized_keys inside www-data ~/.ssh/authorized_keys file so that whenever we go from jenkins@xxx.xx.xxx.xx to www-data@xxx.xx.xxx.xx, I won’t get prompted for password.

So as jenkins, I typed

cat ~/.ssh/id_rsa.pub | ssh www-data@xxx.xx.xxx.xx 'cat >> .ssh/authorized_keys'

Then I typed

ssh -T www-data@xxx.xx.xxx.xx

I was prompted for www-data@xxx.xx.xxx.xx password which I then gave.

I successfully logged in as www-data without getting prompted for password this time, so I exited www-data@xxx.xx.xxx.xx. Now back in server as jenkins user.

Build Jenkins job again. Fail.

As jenkins, I typed

echo "$SSH_AUTH_SOCK"

Nothing was seen.

Tried

ssh-add -L

Got

Could not open a connection to your authentication agent.

Edited /etc/ssh/sshd_config and added

AllowAgentForwarding yes

Checked /etc/ssh/ssh_config. No ForwardAgent no setting.

Build Jenkins job again. Fail.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:59:22+00:00Added an answer on June 17, 2026 at 8:59 am

    For one I noticed that your git clone command may be written wrongly.

    Check:

        <exec command="ssh -A ${host-used} 'git clone -b ${environment.branch} ${repository-uri} ${environment.sitedir}${build.time}'"
    

    I swapped position of ${environment.branch} and ${repository-uri}.

    Reference: git-clone(1) Manual Page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table Datawarehouse which the population went wrong. Each row has a
sorry ma question went wrong a bit the alis has value like alias =Sri
I have a client that I'm wanting to move to a virtual private server.
i have some scripts which give me the alert Something went wrong. I tried
I have installed RSpec with the gem (gem install rspec) command. Everything went ok.
I have hit BUG_ON in kernel code. I want to know what went wrong
A switch went wrong and I committed some files to a a different branch
Not sure where I might have went wrong the code seems fine to me,
Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for
It was working few days ago, don't know what had went wrong... **undefined method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.