Two questions:
1. Is expect the best way to pass credentials to SSH in a bash script? I was hoping for something simpler but it seems like this is the way to do it (without using a passwordless SSH key which is not an option for what I would like to do).
2. Is using the read command a secure way to store credentials while a script is executing? As in, is there any way the credentials could be intercepted or somehow pulled out of the machine's memory or something? All users on the machine are trusted and the firewall rules are pretty strict so I don't need this to be super secure. I am moreso worried if it is a majorly flawed way of collecting credentials security-wise. The credentials would only be stored in a variable within the script and forgotten once it's done.
Thanks in advance.
1. Is expect the best way to pass credentials to SSH in a bash script? I was hoping for something simpler but it seems like this is the way to do it (without using a passwordless SSH key which is not an option for what I would like to do).
2. Is using the read command a secure way to store credentials while a script is executing? As in, is there any way the credentials could be intercepted or somehow pulled out of the machine's memory or something? All users on the machine are trusted and the firewall rules are pretty strict so I don't need this to be super secure. I am moreso worried if it is a majorly flawed way of collecting credentials security-wise. The credentials would only be stored in a variable within the script and forgotten once it's done.
Thanks in advance.