简体   繁体   中英

Does a capistrano deploy.rb file contain server credentials?

This is my first time using Capistrano and I am getting server authentication errors right at the start of my deploy:setup stage. I am a PHP user using rvm on a mac.

I noticed my deploy.rb file does not contain the password to my server. It only contains the password to my private git repo. Is there an attribute available for setting the server password so my connection could authenticate?

Do deploy.rb files list server credentials?

I'd like to refer you to a related discussion . Point in case: It's better to setup publickey authentication for your servers, it saves you from having your credentials stored in plain text and it is safer to begin with.

If you use github for your git hosting, you can use your publickey there as well. Be sure to use ssh_options[:forward_agent] = true to forward your publickey to the server when deploying.

If you really want to set your user and password, I believe you can do it as follows:

set :user, "sshuser"
set :password, "sshpassword"
set :scm_passphrase, "gitpassword"

More info can be found at github help/capistrano

The previous answer covers good info about deploy and i agree it is better to setup public keys.

But if you have password issues, try to add this line:

default_run_options[:pty] = true

to your deploy.rb file, so you allow Capistrano to prompt for passwords.

@Amit Erandole(作为对[ip_address_omitted](Net :: SSH :: AuthenticationFailed:root)的回复,app_name_ommitted(Errno :: ETIMEDOUT:操作超时-connect(2)):看来,不允许通过ssh进行root访问服务器(通常不建议这样做)。以有效的用户再试一次,或者在sshd_config中打开root用户访问权限(PermitRootLogin是)。但是正如HectorMalot已经提到的那样,创建一个ssh密钥并忘记密码。

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