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:

 

{master:1}
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
sdakjfhkajfhksdfhsjghkjsg
lab@UBUNTU:/tftpboot$

 

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

 

% sftp lab@172.30.158.253:/tftpboot/test.txt .
The authenticity of host '172.30.158.253 (172.30.158.253)' 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 '172.30.158.253' (ECDSA) to the list of known hosts.
lab@172.30.158.253's password:
Connected to 172.30.158.253.
Fetching /tftpboot/test.txt to ./test.txt
/tftpboot/test.txt                                                                                               100%   26     0.0KB/s   00:00
% cat test.txt
sdakjfhkajfhksdfhsjghkjsg
%

 

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.

Comments

So empty here ... leave a comment!

Leave a Reply

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

Sidebar



%d bloggers like this: