2014-04-14 14:43:19 +00:00
|
|
|
---
|
|
|
|
title: How can I get Capistrano to prompt for a password?
|
|
|
|
layout: default
|
|
|
|
---
|
|
|
|
|
2014-04-23 02:11:20 +00:00
|
|
|
Password authentication can be done via `ask` in your deploy environment file (e.g.: config/environments/production.rb)
|
2014-04-14 14:43:19 +00:00
|
|
|
|
2015-02-07 17:55:09 +00:00
|
|
|
```ruby
|
2014-04-23 02:11:20 +00:00
|
|
|
# Capistrano > 3.2.0 supports echo: false
|
|
|
|
ask(:password, nil, echo: false)
|
2014-04-14 14:43:19 +00:00
|
|
|
server 'server.domain.com', user: 'ssh_user_name', port: 22, password: fetch(:password), roles: %w{web app db}
|
2015-02-07 17:55:09 +00:00
|
|
|
```
|