I'm running into this problem too. I have the following scenario:
a) I can ssh as my user account but then all commands would need to be
run as sudo
b) I can ssh as another account that has the necessary permissions but
that user has a passphrased private key.
If theres a way to do b) with the current set of options I'd
appreciate it very much if someone could let me know. I tried just
setting :user to the user but I just get prompted for a password that
doesn't do anything when entered:
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
* getting (via checkout) revision 1711 to /var/folders/zc/zcuJupL-
Ewat7ZiCTonV3++++TI/-Tmp-/20080709215524
compressing /var/folders/zc/zcuJupL-Ewat7ZiCTonV3++++TI/-Tmp-/
20080709215524 to /var/folders/zc/zcuJupL-Ewat7ZiCTonV3++++TI/-Tmp-/
20080709215524.tar.gz
servers: ["******"]
Password:
*** [deploy:update_code] rolling back
* executing "rm -rf /sites/test/releases/20080709215524; true"
servers: ["******"]
** [deploy:update_code] exception while rolling back:
Capistrano::ConnectionError, connection failed for: ******
(Net::SSH::AuthenticationFailed: web)
connection failed for: ****** (Net::SSH::AuthenticationFailed: web)
On Jul 9, 10:04 am, Jamis Buck <[EMAIL PROTECTED]> wrote:
> It sounds like you need every command to run via sudo, which is not
> supported by the default deployment recipes. In that case, you'll need
> to write your own, using sudo() instead of run(). Whether sudo prompts
> for a password or not isn't really relevant, since if it does,
> Capistrano will cache the password after the first time and reuse it
> on subsequent prompts.
>
> If you come up some deployment recipes for your scenario, I'm sure
> others will be interested. It doesn't come up often, but when it does
> it is quite frustrating.
>
> - Jamis
>
> On Jul 8, 2008, at 11:24 PM, Artur Matos wrote:
>
>
>
> > Dear all,
>
> > To deploy programs in my environment, I need to be able to change to a
> > specific user first - by running "sudo su <user>", and typing my
> > password.
>
> > I would like to automate my deployment tasks with Capistrano, but
> > Capistrano does not allow me to run sudo. "run "sudo su <user>"" will
> > not work, because sudo always start an interactive shell, and this
> > will make Capistrano block forever waiting for it to close.
>
> > I am aware this was already discussed before on this thread:
>
> >http://groups.google.com/group/capistrano/browse_thread/thread/138db7...)
> > .
>
> > However, none of the solutions proposed at that time really work for
> > me. For instance, I cannot set up my sudo so that it doesn't prompt
> > for passwords (I don't have access to the sudoers file and I cannot
> > change it - company policy). Does anyone had a similar problem? Any
> > workarounds?
>
> > Thanks in advance,
>
> > Artur
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---