Deployment and apt-get password

Subscribe to Deployment and apt-get password 2 post(s), 2 voice(s)

 
Avatar manythink 2 post(s)

I am deploying my application with the Brightbox gem 2.3.6.

The server has a copy of my public SSL key, so “cap deploy” doesn’t constantly ask for the server password.

Unfortunately, the “apt-get update” command is still asking for the password during deployment, despite the public key:

  • executing `packages:install’
    Checking required packages are installed
    Updating apt-get
  • executing “sudo -p ’sudo password: ’ apt-get update -qy >/dev/null”

This gets quite annoying after a while, as it disrupts the otherwise fully automated deployment process.

Is there a way to make “sudo apt-get” use the ssl key instead, or to disable this command altogether?

 
Avatar John Leach Administator 83 post(s)

Hi,

the password is needed to run sudo commands and sudo doesn’t support ssh keys.

You can tell Capistrano the password in the recipe though, and it’ll enter it for you whenever it’s needed:

set :password, “mysecrets”

we do recommend keeping this out of your code repository though – see the advanced gem settings page on the wiki for example of how to do this:

http://wiki.brightbox.co.uk/docs:gemv2:advanced…

John.

Signup or login to contribute