0

I have a really old Debian remote Server.

Unfortunately the APT is broken so I cant update or install anything. The last thing before I delete the Server is download some files and folders.

I know I can do it with SCP but because the Server is so old I cant connect with ssh in one step.

I have to do that command to get into the server:

ssh -oKexAlgorithms=diffie-hellman-group1-sha1 -c aes128-cbc [email protected].

The problem is when I want to download something with SCP it stops because of the missing encryption and ciphers.

Debian Version: Debian GNU/Linux 3.1

3
  • Why can't you use the same connection options and cipher for scp as you do for ssh? Mar 7, 2022 at 9:56
  • Because I dont know how to integrate it into the SCP command. How would it look like? Mar 7, 2022 at 9:57
  • Exactly the same. I've added you an answer Mar 7, 2022 at 10:01

2 Answers 2

2

You can pass the same SSH options to scp as you can pass to ssh:

scp -r -oKexAlgorithms=diffie-hellman-group1-sha1 -c aes128-cbc [email protected]:/ /home/freddy/backup

Alternatively, the good' ole "pipe a tar archive through SSH" still works - without scp, and especially on old scp implementations with less well-designed buffer management/queuing might me much faster.

ssh -oKexAlgorithms=diffie-hellman-group1-sha1 \
    -c aes128-cbc \
    [email protected] \
    tar -cfz - folder/to/be/sent \
    | \
    tar -xzf - 
2
  • Thank you! That worked. I dont know why it didnt work for me as I tried to implement the encryption and ciphers. I bet I mistyped all the time. Mar 7, 2022 at 10:06
  • 1
    "I bet I mistyped all the time" you can set these as preferences in your ~/.ssh/config for the target host. See man ssh_config for details, or search here on U&L Mar 7, 2022 at 19:22
1

You can use exactly the same options for scp as you can for ssh

scp -o KexAlgorithms=diffie-hellman-group1-sha1 -c aes128-cbc [email protected].  remoteUser@remoteHost:/path/to/files… /local/path/to/files

See man scp for the details; here's the summary:

SYNOPSIS

scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .