4

I'm trying to connect to a FTPS (explicit TLS FTP) server within a shell script and i'm kinda confused. I tried using the regular FTP command, but i get 534 error "policy requires SSL" and 504 "Security mechanism not implemented"

ftp -inuv myhost

Returns 504 then

quote USER myuser

Returns 534

I also tried sftp but i get "couldn't read packet: connection reset by peer". That damn peer is making my life a nightmare since IRC ;)

sftp myuser@myhost:mydirectory/ -P21

Connexion reset by peer and it says it can't connect to port 22, which is weird since i specified port 21...

Thanks for your help

1 Answer 1

2

There is a diference between ftps and sftp : sftp is ftp over ssh, so in your case you cannot use sftp. ftps is ftp that use ssl/tls

You need an ftp client that manages TLS, for instance http://lftp.yar.ru/ (found on the net)

4
  • I understood that SFTP and FTPS were different but i somehow hoped that i could handle TLS with the bundled ftp applications on my system. Thanks, i'll try that and update this post accordingly. May 14, 2013 at 14:08
  • Thanks, after a lot of reading and trying, it works like a charm in a single command : May 14, 2013 at 14:50
  • Could you give the command, it may be useful for someone else May 14, 2013 at 19:05
  • It actually worked just like that : export SSHPASS=MYPASS /usr/local/bin/sshpass -e sftp -oBatchMode=no -b - LOGIN@HOST << ! DO FTP STUFF HERE bye ! Feb 6, 2014 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.