Urgent!! File transfer from Windows to Linux server using ftp
Dear All
I need your help. I want to get a file from windows server using ftp. Below is the script I have created but the connection is not established: #!/bin/sh lcd "directory in linux server" USER="username of windows server" PASS="password" ftp -n "ip of windows server" <<EOF user $USER $PASS cd "C:\Users... directory in windows server where file is located" bin get test1234.txt bye EOF I hope somebody can help me! BR, |
Move the lcd command inside the ftp script as it is not a valid sh command.
|
Thank you for your reply!
I follow your suggestion but again I cannot connect. Below is the error i get ftp: connect: Connection timed out Not connected. Local directory now /home/omc/Script/test Not connected. Not connected. |
Have you verified that the FTP server is actually installed and working on the remote machine? Looks like the client cannot connect. Can it ping the server? Are all necessary ports operned (i.e. not firewalled).
|
Perhaps you need to give time for each ftp command.
Or better use a expect script. You can also use ncftp to do batch upload of files. |
Thank you for reply
I made a test to transfer the file from windows to linux server and i got this: C:\Users\Admin>ftp -n "Linux server IP" Connected to "Linux server IP". 220 (vsFTPd 2.0.5) ftp> lcd C:\Users\Admin\Documents\test\ \Users\Admin\Documents\test\: F ftp> user root "password" 530 Permission denied. Login failed. ftp> It seems the there is a Firewall issue. I'm new in this stuff so could somebody help me? I want to highlight that i'm interested to get the file from Linux server, not to use other ftp software. Thank you in advance.. |
I'm not surprised.
ftp root access should never be allowed. Do you want the world to have access to your Linux machine? Try a different user. |
All times are GMT -5. The time now is 08:06 AM. |