Reputation: 231
I have an FTP Script as below. And I want the same to be converted to Secured FTP (SFTP) script.
FTP_OUT=`ftp -v -n << END_SCRIPT
open $HOST
user $USR $PWD
lcd $LOC_PATH
cd $REM_PATH
mput $FILENM
quit
END_SCRIPT`
Suggest the SFTP equivalent of the above FTP script to transfer file from local server to remote server.
Upvotes: 0
Views: 545
Reputation: 1164
You should use scp
scp filename user@host:remote_path
This requires you to enter the password. If you want to avoid entering the password every time you use scp, you could generate an authentication key with ssh-keygen
.
Upvotes: 1