部署的时候发现需要输入服务器密码,不能直接登录
DEBUG [ab5be9b4] Running /usr/bin/env [ -d $HOME/.rbenv/versions/2.3.0 ] on 10.103.xx.xx DEBUG [05871a47] Running /usr/bin/env [ -d $HOME/.rbenv/versions/2.3.0 ] on 10.103.xx.xx DEBUG [dd74890c] Running /usr/bin/env [ -d $HOME/.rbenv/versions/2.3.0 ] on 10.103.xx.xx DEBUG [ab5be9b4] Command: [ -d $HOME/.rbenv/versions/2.3.0 ] DEBUG [05871a47] Command: [ -d $HOME/.rbenv/versions/2.3.0 ] DEBUG [dd74890c] Command: [ -d $HOME/.rbenv/versions/2.3.0 ] Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text. root@10.103.xx.xx's password:Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text. root@10.103.xx.xx's password:Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text. root@10.103.xx.xx's password:
3.0+版本config/deploy.rb 取消了user的写法
set :user, 'webuser'
需要用这样的写法
set :ssh_options, { user: 'webuser' }
https://github.com/capistrano/capistrano/blob/621985511529893d972e79452ad63eb54430fb4c/lib/capistrano/templates/stage.rb.erb
或者在deploy/production.rb里设置ssh用户名
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value # server 'db.example.com', user: 'deploy', roles: %w{db}