using scp to copy files from 1 unix server to another regularly and performing certain actions. to do this quickly I wish to use a unix script which does the scp and inputs the password required to complete the scp.
I have tried the expect command to send the password throught the unix command line however unable to achieve this so far.
scp ./abc.txt hostname/abc.txt
couldn't read file "password: ": no such file or directory
myscript.sh: send: not found [No such file or directory]
Here is how I resolved it.
It is not the most secure way however it solved my problem as security was not an issue on internal servers.
Create a new file say
password.txt and store the password for the server where the file will be pasted. Save this to a location on the host server.
scp -W location/password.txt copy_file_location paste_file_location