Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically ftp using specific port

Status
Not open for further replies.

charles0681

Technical User
Apr 3, 2017
4
NI
Please, your help.

I've trying to make a script for send a file via ftp and specific port I have tried of many different way but it not works.

I tried with the following code but when I run the script I receive a authentication error.

ftp -n '<ip> port' <<END_SCRIPT
quote USER
quote PASS 
cd /path/dest
bin
prompt
put /dir/to/orig/file.txt
bye
END_SCRIPT

Thank you in advance
 
Your script has no values for username or password so is not going to authenticate.




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hello Chris, thanks for your comments.

Yes it has.
I wrote so as an example but maybe I must to be most specific with the code.

ftp -n '<ip>' 'port' <<END_SCRIPT
quote USER ftpuser
quote PASS ftppassword
cd /path/dest
bin
prompt
put /dir/to/orig/file.txt
bye
END_SCRIPT


Error shown

Connected to <ip>
220 Microsoft FTP Service
504 Security mechanism not implemented.
504 Security mechanism not implemented.
KERBEROS_V4 rejected as an authentication type
Remote system type is Windows_NT.
ftp> dir
530 Please login with USER and PASS.
Passive mode refused. Turning off passive mode.
530 Please login with USER and PASS.
ftp: bind: Address already in use
ftp>

Thank you in advance !!
 
I wrote so as an example but maybe I must to be most specific with the code.
Yeah, showing what the code actually isn't, will likely lead to erroneous conclusions. [smile]

Assuming you are on a Windows machine.
I would suggest you ditch using the M$ Windows FTP client and try WINscp because the error messages make it look like the server wants TLS and the client probably doesn't support it.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
You right Chris, I'm tryingo to do a ftp from a linux computer to Windows Server but when I try I did receive the error previously mentioned if I do ftp manually I can open the FTP conection, but when I try to do fpt via script I receive the same error. I did open the port 20 and 21 it should works but it is not so.

Thank you Chris for your help.

Br,
 
I fixed the problem thank you very much for your help.

I just needed to use ascii before to send user/password
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top