How do I fix a cipher mismatch issue with sftp?
The Cipher
directive is for SSH version 1 (which is not in use nowadays).
For SSH version 2, use the Ciphers
:
sftp -oCiphers=aes256-ctr
See the ssh_config
man page.
Though note that the sftp
supports the -c
switch too. So there's no need for using the -o
.
See the sftp
man page:
-c cipher
Selects the cipher to use for encrypting the data transfers.
This option is directly passed to ssh(1).
The option is supported since OpenSSH 5.4. The change is disguised as "Support most of scp(1)'s commandline arguments in sftp(1)".
Note the command-line argument -c
is primarily an equivalent to the Ciphers
directive (while it can fall back to the Cipher
). Quote from the ssh
man page:
-c cipher_spec
Selects the cipher specification for encrypting the session.
Protocol version 1 allows specification of a single cipher. The supported values are “3des”, “blowfish”, and “des”. For protocol version 2,cipher_spec
is a comma-separated list of ciphers listed in order of preference. See theCiphers
keyword in ssh_config(5) for more information.