简体   繁体   中英

Capistrano: Do not ask for password

I have a rails capistrano task that deploys code and works, however when it checks out the code from my server's git repo it asks for a password, twice, is there a way I can bypass this by putting the password in the capistrano script? Code example is below...

set :repository, "ssh://gituser@example.com/opt/git/hub/app.git"
set :deploy_via, :copy
# server stuff unrelated..
  set :user, "deployer"
  set :password, "password"

I am using capistrano 2 btw. Thanks.

ssh tools generally have your clients' backs, and never allow passwords on commandlines.

Look up "passwordless SSH". You will generate a public key and private code, ~/.ssh/id_rsa.pub and ~/.ssh/id_rsa. That's enough to get you Googling; you will upload the key & code to your server, then upload the key to your GIT repository (following its owners' instructions.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM