0

We are writing the automatic script to connect my servers using the shell script. We do not have the password for the server. We have only public ssh passphrase. We have tried passphrase instead of the password in this comment but it says permission denied sshpass -p password ssh user@host. Is there any way to connect the server through public passphrase in the shell script?

esu
  • 2,220
  • 8
  • 19
  • 30
  • Does your question imply that you never managed to connect/authenticate to the server? If that's the case, you need to contact your server Administrator, not ask on a public forum. – Martin Prikryl Aug 06 '18 at 07:24
  • No. We are connecting the our servers using this passphrase only. Now we are writing the automated script the connect the server and copy some of files via the script. Thats why are looking for the comment to login into the IP using ssh passphrase in scripts. – esu Aug 06 '18 at 07:52
  • I assume you mean *"command"*, not *"comment"*, right? – Martin Prikryl Aug 06 '18 at 07:53

1 Answers1

0

If you want to use a private key automatically, just remove the passphrase.

To remove a passphrase, you can use:

ssh-keygen -p -P passphrasse -N "" -f keyfile

Though sshpass should work too, while it makes a little sense using it for this purpose.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992