-1

I am trying the putty plink and pscp commands from a windows batch file to download file from Linux server.

For server#1, these commands works fine when the remote server has SFTP enabled(port will be 22 in the given command). For server#2, which has only FTP enabled, plink is not working.

Server #1(SFTP) => plink 10.238.xxx.xxx -P 22 -l "uname" -pw "pass123" -- This works

Server #2(FTP) => Tried below 2 commands, but no luck

plink uname@10.238.xxx.xxx -P 21 -pw "pass123" -- This does not work

plink 10.238.xxx.xxx -P 21 -l "uname" -pw "pass123" -- This does not work

To make sure only FTP works on Server #2, tried connecting on WinSCP and could see that SFTP does not work and I am able to connect and download when the file protocol selected is FTP. When selecting SFTP, getting the error - "You are trying to access a restricted zone. Only Authorized Users allowed." which is expected in my case.

Please share your views on how to use plink & pscp to download files over FTP.

user123
  • 11
  • 5

1 Answers1

1

plink do not operate FTP protocol. If you want to use FTP you have to use proper client (windows have build-in client try command ftp /?. If you server support SCP protocol to file transfer, you could use pscp.exe (plinks brother).

user2956477
  • 1,208
  • 9
  • 17
  • That. And also, plink cannot be used to download *anything*. It's not a file transfer tool. – Martin Prikryl Mar 19 '20 at 10:30
  • @MartinPrikryl - I am using plink for executing ssh commands where as pscp is used for download/copy files between a remote server and a windows machine – user123 Mar 19 '20 at 10:59
  • I'm not sure I understand. Are you trying to use `plink` to execute `pscp` on a remote machine to transfer file to/from yet another remote machine? – Martin Prikryl Mar 19 '20 at 11:03
  • @MartinPrikryl For me, both `plink` and `pscp` are not working. The server has only FTP enabled. Could you please suggest an alternative approach in this case ? – user123 Mar 19 '20 at 11:08
  • You already got a suggestion from @user2956477 – Use FTP client. You cannot use `plink`/`pscp` with FTP server. – Martin Prikryl Mar 19 '20 at 11:13