-2

I'm looking for a shell/bash script that can be used to transfer a file from my local to a remote serve using sftp protocol.

I have the one for ftp but can't figure out for sftp. Any help here would be greatly appreciated.

Jakuje
  • 24,773
  • 12
  • 69
  • 75
Ashley
  • 1,447
  • 3
  • 26
  • 52

1 Answers1

1

You could use lftp:

lftp -u USER,PASS -e "put LOCAL_FILE;quit" sftp://SERVER_ADDRESS
Jakuje
  • 24,773
  • 12
  • 69
  • 75
Jandisson
  • 380
  • 1
  • 10
  • Does the server_address here means server address/remote_path or how do i include the remote path. Also if i wanted to use ssh key here how would i use that instead of password. – Ashley Aug 15 '16 at 14:13
  • You can add /path in the SERVER_ADDRESS. About the key, please see http://stackoverflow.com/questions/11577090/lftp-with-key-passphrase – Jandisson Sep 01 '16 at 19:05