error: put-file failed on Junos

I have got the following error while I was trying to copy a file via SCP on Junos. As per the error, I thought it is something
to do with my local permissions but I could read the source backup.conf file. I searched online, numerous entries showed up.

yilmaz@host> file copy backup.conf scp://yilmaz@10.1.1.1:~/
yilmaz@10.1.1.1's password:
scp: /backup.conf: Permission denied
error: put-file failed
error: could not send local copy of file

In the end, error turns out to be so funny. It is the “~” character which is causing this issue. As soon as I changed the destination
path as follows;

yilmaz@host> file copy backup.conf scp://yilmaz@10.1.1.1:/home/yilmaz/

it just went through. Apparently this isn’t interpreted as “HOME” directory in Junos the way it works in Linux.
Another lesson learned!

About: rtoodtoo

Worked for more than 10 years as a Network/Support Engineer and also interested in Python, Linux, Security and SD-WAN, currently living in the Netherlands and works as a Network Support Engineer. // JNCIE-SEC #223 / RHCE / PCNSE


You have a feedback?

This site uses Akismet to reduce spam. Learn how your comment data is processed.