Description

This article provides a workaround in case file copy to the FTP server via CLI does not work on devices that are running Junos EVO version 20.2R2-S1.5.
'

Symptoms

In Junos EVO version 20.2R2-S1.5, file copy by using the Command Line Interface (CLI) does not work. The file copy command results in login failure even though a correct syntax has been used, whereas the same command works in later releases such as Junos OS software version 20.4R3.8-EVO.

File Copy to FTP in Junos 20.2R2-S1.5-EVO Fails

--- JUNOS 20.2R2-S1.5-EVO Linux (none) 4.8.28-WR2.2.1_standard-ga95c0d7 #1 SMP PREEMPT Tue Jan 5 00:47:33 PST 2021 x86_64 x86_64 x86_64 GNU/Linux

lab@router> file copy /var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso ftp://[email protected]/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso
--07:01:35-- `/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso'
    => ftp://lab:[email protected]:21/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso
Error: Login-Sequence failed (Login incorrect.)
Skipping all files from this account...
error: put-file failed
error: could not send local copy of file

File Copy to FTP in Junos 20.4R3.8-EVO Succeeds

lab@router> file copy /var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso ftp://[email protected]/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso 
Password for [email protected]:
--06:47:29-- `/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso'
    => ftp://lab:[email protected]:21/var/tmp/junos-evo-install-ptx-fixed-x86-64-20.4R3.8-EVO.iso

Solution

As a workaround, log in to the shell and connect to the FTP server before copying the file. Use the following command:

lab@router> start shell 
[vrf:none] lab@router:/$ /usr/libexec/ui/evo_ftp
ftp> open 10.85.173.152
Connected to 10.85.173.152.
220 another-re0 FTP server (Version 6.00LS) ready.
/usr/bin/ftp: /var/home/lab/.netrc: Permission denied
Name (10.85.173.152:lab): lab
331 Password required for lab.
Password: 
230 User lab logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /var/tmp
250 CWD command successful.
ftp> put <file name>
200 PORT command successful.
150 Opening BINARY mode data connection for 'init'.
226 Transfer complete.
30514 bytes sent in 0.00109 seconds (26.8 Mbytes/s)
ftp> bye
A couple of PRs that provide resolutions depending on the nature of the problem (in-band FTP transfer, user/password issue) include: PR1561146 and PR1587646 .

Modification History

2021-12-31: Updated PR information for problems with fixes available