Search code examples
unixputtyplink

Putty Plink to download remote file not working


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 [email protected] -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.


Solution

  • 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).