Ogni giorno mi collego a un server tramite ssh. Eseguo questa routine:Come inserire la password ssh usando bash?
IC001:Desktop user$ ssh [email protected]
[email protected]'s password:
Last login: Tue Jun 4 10:09:01 2013 from 0.0.0.0
$
Vorrei automatizzare questo processo e creare uno script bash per farlo per me. Non mi interessa la sicurezza e ok per memorizzare la mia password apertamente nella sceneggiatura. Sto anche bene che venga digitato apertamente sullo schermo mentre lo script viene eseguito. Quindi ho creato questo:
#!/bin/bash
ssh [email protected]
echo mypassword
Ma non funziona. Ho anche provato send
anziché echo
, ma non ha funzionato. Si prega di avvisare se è possibile farlo.
https://help.ubuntu.com/community/SSH/OpenSSH/Keys – Kevin
@ Kevin, io non sono responsabile dei server. Sono solo un utente che si connette a loro. Non sono autorizzato a modificare NULLA sul server. – Prostak
anche: http://stackoverflow.com/questions/4780893/use-expect-in-bash-script-to-provide-password-to-ssh-command?rq=1 http://stackoverflow.com/questions/ 13298487/bash-script-to-ssh-in-a-machine-without-prompting-password-and-without-using-k? Rq = 1 http://stackoverflow.com/questions/3796345/can-i-use -a-heredoc-to-enter-a-password-in-bash? rq = 1 – jm666