Using sftp in Junos

You can use sftp to transfer files to and from Juniper devices.

You can initiate the transfer to and from the Juniper device from the Juniper device itself using the command “sftp” from shell:


lab@EX4200-VC> start shell
% sftp
usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
          [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
          [-o ssh_option] [-P port] [-R num_requests] [-S program]
          [-s subsystem | sftp_server] [-JU rt_inst] host
       sftp [user@]host[:file ...]
       sftp [user@]host[:dir[/]]
       sftp -b batchfile [user@]host


You can transfer any files you want, for instance, the software images.

This is how you can do it.

I have one file on the Linux server that I will copy to the Juniper device:


lab@UBUNTU:/tftpboot$ cat test.txt


And this is how you can copy the file using sftp:


% sftp lab@ .
The authenticity of host ' (' can't be established.
ECDSA key fingerprint is d8:6e:2f:9f:47:ad:74:6f:72:71:0a:51:4e:f9:a0:51.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ECDSA) to the list of known hosts.
lab@'s password:
Connected to
Fetching /tftpboot/test.txt to ./test.txt
/tftpboot/test.txt                                                                                               100%   26     0.0KB/s   00:00
% cat test.txt


Although there is not that much use case of sftp because you can use scp, it’s good to know that the command is there and you can use it if you want to.


The following two tabs change content below.

Paris ARAU

Paris ARAU is a networking professional with strong background on routing and switching technologies. He is a holder of CCIE R&S and dual JNCIE(SP and ENT). The day to day work allows him to dive deeply in networking technologies. Part of the continuously training, he is focusing on Software Defined Network and cloud computing.


So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *


%d bloggers like this: