Score:0

Handling manual inputs in ssh script

co flag

I am accessing a remote machine using ssh and have written a simple bash script on my host pc to copy files from the remote computer to the host.

which is simply: scp remote@ip:/path/to/file/ destination

But I get this promt everytime to input the password for the remote machine and am therefore not able to run this script while I am away from the computer.

Is there any way around this difficulty. for example, I do not have to type the password but it can access it from some file available in host directory automatically.

Thanks.

Anthony Kelly avatar
ng flag
See this thread on Stack Overflow: https://stackoverflow.com/questions/50096/how-to-pass-password-to-scp
lost_in_paradise avatar
co flag
Thanks! that worked
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.