Scp router to pc?

Hi,

I know I can do it via winscp but it is not working after installation, anyway I want to do it via scp.

I tried that ; (btw, is it just an exemple)

scp -r perkel@pop-os:/etc/init.d/banip/* /home/perkel/Documents

I think it is something like that but I dont know where is the error.
thanks

What happens when you do this? Do you see an error?

2 Likes
/usr/bin/dbclient: Connection to perkel@pop-os:22 exited: Connect failed: Connection refused

check the host called "pop-os" to ensure that it allows incoming ssh connections. Currently, it is refusing them.

2 Likes

As a diagnostic, you can use ssh -v to test out the connection as it uses the same underlying mechanism as scp. This might tell you where things are failing (user name? host name? key type?).

ssh -v perkel@pop-os

Once the above works, the scp should work, too.

1 Like

You may need to add in this switch: -O

3 Likes

Scp -O -r ?

1 Like

from my local pc ;

OpenSSH_9.6p1 Ubuntu-3ubuntu13.5, OpenSSL 3.0.13 30 Jan 2024
debug1: Reading configuration data /home/perkel/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to pop-os [192.168.1.178] port 22.
debug1: connect to address 192.168.1.178 port 22: Connection refused
ssh: connect to host pop-os port 22: Connection refused

Did you do this:

2 Likes

so now, I did it and it seems to working

sudo apt-get remove openssh-client openssh-server

    sudo apt-get install openssh-client openssh-server

after that here what I did;

root@OpenWrt:/etc/config# scp -r perkel@pop-os:/home/perkel/Documents/* etc/init.d/adblock-lean/

Host 'pop-os' is not in the trusted hosts file.
(ssh-ed25519 fingerprint SHA256:xxxxxxxxxxxxxxxxxxxxxxxx)
Do you want to continue connecting? (y/n) y
james@pop-os's password:
etc/init.d/adblock-lean/: No such file or directory
etc/init.d/adblock-lean/: No such file or directory

screenshot-2024-12-06-19-21-50

You need a leading slash.... for this part:

etc/init.d/adblock-lean/

It should be:

/etc/init.d/adblock-lean/
3 Likes

almost there, thank you

root@OpenWrt:/etc/init.d# scp -r james@pop-os:/home/james/Documents/* /etc/init.d/adblock-lean/
james@pop-os's password:
/etc/init.d/adblock-lean/: Is a directory
/etc/init.d/adblock-lean/: Is a directory

in adblock-lean (etc/init.d/adblock-lean) there is the process file and when I do cat /etc/init.d/adblock-lean I can read it, so why I can't scp it?

can't have a folder and file with the same name ?

You are trying to copy a directory to a place where a file with the same name already exists.

I try to take adblock-lean file in init.d to my local pc in documents

also when I do that ;

root@OpenWrt:/etc/init.d# scp -r perkel@pop-os:/home/perkel/Documents/* /etc/init.d/adblock-lean
perkel@pop-os's password:
rx.pdf                                                                              100%   62KB 
vet.pdf                                                                            100%   27KB

I see the 2 files I have in my documents directory on my pc

in that case, you're doing it backwards:

scp <source> <destination>
1 Like

so I can't transfert the adblock-lean file to my pc?

You can... you've just been doing it backwards.

I tried it

root@OpenWrt:/tmp# scp perkel@pop-os:/etc/init.d/adblock-lean/* /home/perkel/Documents/
perkel@pop-os's password:
scp: /etc/init.d/adblock-lean/*: No such file or directory

still not right...

scp /etc/init.d/adblock-lean/* perkel@pop-os:/home/perkel/Documents/
1 Like