Search code examples
shellpasswordsscppromptkeyboard-events

How to respond to password prompt when using SCP in a shell script?


First of all, I am well aware of that there are many of questions regarding this topic. I have read them, but still could figure out an appropriate answer for my situation.

I would like to scp the entire ~/cs###/assign1 dir from local to school home dir with a shell script. My question is, is there a way in my script to wait for the password prompt, and then simulate key board event to 'type' in my password?


here is a really detailed guide of how to set up the key


Solution

  • Are ssh keys not allowed? That would be a better solution.