1

I tried to deploy my app to digital ocean server following this tutorial.

https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma

So i can clone my apps successfully but when deployed the production one it required me to enter passphrase but when i type it in my terminal it seems like nothing happened like this

cap production deploy:initial
deploy@xxxxxx's password: 
deploy@xxxxxx's password: 
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby-2.3.0
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
00:00 git:wrapper
      01 mkdir -p /tmp
    ✔ 01 deploy@139.59.235.223 0.080s
      Uploading /tmp/xxxx.sh 100.0%
      02 chmod 700 /tmp/xxxx.sh
    ✔ 02 deploy@139.59.235.223 0.088s
00:00 git:check
      01 git ls-remote --heads git@bitbucket.org:xxxx/xxxx.git
      01 Enter passphrase for key '/home/deploy/.ssh/id_rsa':
password101
passwordyololo
howtotypepassword

So how can i enter the passphrase in my terminal and pass this kind of security?

Thanks!

Varis Darasirikul
  • 3,907
  • 9
  • 40
  • 75

2 Answers2

2

SSH key authentication done correctly shouldn't trigger a username-password check.

Try adding your SSH key to the authorized keys on your droplet. You can check your setup by making a SSH connection to your droplet, if it asks for a username-password then redo your setup.

cat ~/.ssh/id_rsa.pub | ssh -p your_port_num deploy@your_server_ip 'cat >> ~/.ssh/authorized_keys'

Also since you added a passphrase to your ssh key, you will need to add your SSH key to the ssh-agent so that it will remember your passphrase without you typing it every deploy.

ssh-add -k ~/.ssh/id_rsa

Additional info in working with ssh keys with passphrases: https://help.github.com/articles/working-with-ssh-key-passphrases/

jemonsanto
  • 513
  • 8
  • 19
0

You need to setup your keys first. See: https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma#step-5-—-setting-up-ssh-keys

mrlindsey
  • 300
  • 2
  • 12