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 6598627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:22:30+00:00 2026-05-25T18:22:30+00:00

I have a Webistrano setup that deploys with its own private/public key pair. I

  • 0

I have a Webistrano setup that deploys with its own private/public key pair. I would like to harness the simplicity of :remote_cache strategy, but don’t want to copy the private key to the deployment server.

So long I have these tasks set up:

namespace :ssh do 
  task :start_agent do 
    ssh_options[:forward_agent] = true
    result = `ssh-agent -t 600`
    # Extract env variables
    %w(SSH_AUTH_SOCK SSH_AGENT_PID).each do |key|
      if result =~ /#{key}=(.*?);/
          ENV[key] = $1
      end
    end
    cmd = "ssh-add #{ssh_keys}"
    result = `cmd`
  end 

  task :stop_agent do
    # Kill the agent started previously
    `ssh_agent -k $SSH_AGENT_PID`
  end
end 

before 'deploy', 'ssh:start_agent'

This before :deploy seems to work half way, but I have few problems:

  1. I need to stop the agent after deploy (and after failed deploy). Is there any callback I can hook the ssh:stop_agent task?
  2. The deploy:update_code task fails with error Unable to resolve revision for ‘master’ on repository ‘git@git.eenet.ee:base/mms.git’

Can anybody shed any light on this?

  • 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-05-25T18:22:30+00:00Added an answer on May 25, 2026 at 6:22 pm

    To answer my own question, I resorted to externally start ssh-agent via cron @reboot and bind it to a pre-known socket and add webistrano key to that agent:

    @reboot laas sh -c 'eval `ssh-agent -a /path/to/my/ssh-agent.sock`; ssh-add /path/to/webistrano/config/id_rsa'
    

    So that I can write a simple Webistrano recipe that configures ENV to use that socket:

    ssh_options[:forward_agent] = true
    ENV['SSH_AUTH_SOCK'] = '/path/to/my/ssh-agent.sock'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have a photography site that I want to prevent image copying from. How can
Has anyone had any success in getting Webistrano running on Windows. Everywhere I have
Have advancements in CPU design like dynamic instruction scheduling narrowed the performance gap between
Have some dates in my local Oracle 11g database that are in this format:
Have an app that can use tts to read text messages. It can also
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
Have a large amount of HTML, but where I thought the bottleneck would be
Have a rails app that is supposed to display a list of products/managers. After

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.