I need to execute scp
command without using expect
command in script.
How to use scp with password? I have tried with following code.
HOST=lnx1
USERNAME=user
PASSWORD=pwd
PATH=/sample/data/
FILE=$1
scp $FILE $USERNAME:'$PASSWORD'@$HOST:$PATH
sshpass -p '$PASSWORD' scp $FILE $USERNAME@:$PATH
Error messages:
scp: command not found
sshpass: command not found
How to achieve this thing?
user
should be your actual user name. – terdon♦ Sep 19 '14 at 12:59