I am trying to write a script to automatically upload files to a sftp server. My problem is authentication.
- I know it is not possible to store a password in a bash script for sftp.
- I can't use keys because the admin of the server won't allow me.
- I don't want to use any extras (sshpass/expect) because I can't guarantee they will be on the machine I'm using (the script are wanted so that the processes are not tied down to a particular machine).
Manual entry of the password is not a problem I just need to get the script to wait for the user to put the password in. At the minute when I run the script it opens terminal, prompts for the password, but when this is entered nothing else happens. If I enter the lines of code manual after it uploads everything correctly.
#!bin/bash/
cd /remote_directory
lcd /local_directory
put some_file.txt