0

I'm trying to execute the below command:

#sudo ssh -o StrictHostKeyChecking=no username@serverip /var/scripts/test.sh

How can I use this command without ssh keys and with encrypted password in a script?

MorLavender
  • 106
  • 1
  • 8
  • See http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password – mata Oct 10 '16 at 10:51
  • Neither of those posts address the question asked, which is a reasonable one. In fact I need to do exactly what has been asked (just haven't gotten onto it). – Nico de Wet Oct 21 '16 at 09:25

1 Answers1

0

You could use say a tool such as Ansible Vault (or equivalent) to encrypt the password, then feed it into the ssh command with sshpass.

You will end up with a master passphrase with such a setup of course.

Nico de Wet
  • 319
  • 2
  • 12