Help copying file to router

I just posted about this earlier and had a typo in my line. I am having another issue with the following line:
scp openvpn/ root@OpenWrt:/etc/openvpn/*

I am prompted to enter my password but then I receive the following error:
"openvpn/*: No such file or directory"

The folder "etc/openvpn/" is already on my router and the file "openvpn" is located on my SSD.

Any help would be appreciated as I am a noobie.

you need to run with the -r argument (recursive for a directory):
scp -r openvpn/ root@OpenWrt:/etc/

You also don't want the trailing openvpn/* in the destination or it will end up in /etc/openvpn/openvpn/<files>.

The other thing to check: are you in the correct directory on your computer (i.e. the directory from which you are running the command contains the openvpn directory)?


you can also mount the router as a filesystem without running scp or sftp etc. fish, its inbuilt in kde. works over ssh without other services.

Thanks for the help. I followed your suggestions, but unfortunately I still receive the same error. I am also running cmd from the same location as where the folder I am trying to copy is located.

Edit - Also I am on Windows 10. Is that an issue?

Hi thanks for your help. Unfortunately I am very novice at this, so I do not know how to do this.

On WIndows you may need to use backward slashes for the local path. Though it should also work to be in the directory above the one that you want to copy and use -r with the subdirectory name and no slashes.

Or cd into the local subdirectory and use * for the local filename to copy all files. -r * should also copy all further subdirectories.

The remote path would be forward slashes. The remote path must always end with the name of a directory that already exists on the remote system, except in the special case where you are copying only one file and want to change it to a different filename on the remote system as it is being copied.

i told you because this method imo is easiest of all. it requires no extra setup of setting up any kind of server. depending on what distro youre running. or even windows. well, all i know is kde. you go to network > add > fish protocol > fill in credentials and connect. set up in 1 minute or less. plus you can access it through dolphin file manager after. maybe just apt install dolphin its convenient. all you need is dropbear enabled, no other fancy stuff. if you can login your router with ssh. same protocol it will use.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.