Script for uploading from Raspberry Pi with ftp but using TLS 1.2

Commissario
Joined
16 Oct 2002
Posts
342,976
Location
In the radio shack
My hosting company didn't bother telling anyone but they're now insisting all ftp access is done using TLS 1.2.

My simple ftp script has stopped working.

Code:
#!/bin/sh

cd /home/upload_temp/ftp/files
sudo cp index.upload index.html
sudo chown root:root index.html
sudo chmod +x index.html

HOST='my_server_hostname'
USER='mu_username'
PASSWD='my_password'
FILE='index.html'

ftp -n $HOST <<END_SCRIPT
user ${USER} ${PASSWD}
cd /upload
put $FILE
quit
END_SCRIPT

exit 0

I've spent a while trying to understand what I need to do here to make it work using TLS.

Can anyone help please?

Thanks.
 
Assuming it’s just one file you can replace as follows:

Code:
scp <filename> user@host:<path>/

The above command will prompt you for a password. To make the command passwordless setup a private key pair. You’ll find instructions on google on how to do that.
 
Back
Top Bottom