Scp path/file to buildroot


If I want scp those files : /etc/init.d/banip and /usr/lib/
and keeping the directory layout in my buildroot/files, ie; openwrt/files/etc/init.d/banip, what would be the best ? Or rsync would be better to do that? I tried that ; scp /etc/init.d/banip admi@localhost:/run/media/perkel/D/ipq806x_builds/owrt2203/files/ but I got that ; /usr/bin/dbclient: Connection to xxx@xxx:22 exited: Connect failed: Error resolving 'xxx' port '22'. Name does not resolve lost connection

Probably easiest to do from the buildhost.
(At least I think so, as my buildhost is virtualbox)

cd owrt2203/files/etc/init.d
scp root@ .

You might need to mkdir the needed directories, naturally.

Ps. Regarding your error, if you are doing that in windows wsl, you might need to config Windows firewall, if you are trying to initiate the connection from the router's side.

1 Like

And also beware that OpenWrt's scp is using legacy file transfers instead of the newer sftp internally, so you might need to use the -O (Old?) option to get it to work properly. I have to do this from Windows, Ubuntu and Fedora now:

scp -O files router:/some/where/

I did overcome that by installing the openssh-sftp-server into router, and the new scp in Ubuntu 22.10 works ok even without -O

1 Like

I will try, thanks, I'M on linux machine

it did not work but I've installed filezilla, kind of winscp, and It worked.