Skip to main content
Format both server and client lists as line-based and sorted for easier comparison.
Source Link
Mark Stosberg
  • 8.2k
  • 1
  • 36
  • 44

To disable RC4 and use secure ciphers on SSH server, hard-code the following in /etc/ssh/sshd_config

ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

OR if you prefer not to dictate ciphers but merely want to strip out insecure ciphers, run this on the command line instead (in sudo mode):

sshd -T | grep ciphers | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|[email protected]\)\,\?//g" >> /etc/ssh/sshd_config

You can check ciphers currently used by your server with:

sudo sshd -T |grep| grep ciphers | perl -pe 's/,/\n/g' | sort -u

Make sure your ssh client can use these ciphers, run ssh -Q cipher

ssh -Q cipher | sort -u

to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server, hard-code the following in /etc/ssh/sshd_config

ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

OR if you prefer not to dictate ciphers but merely want to strip out insecure ciphers, run this on the command line instead (in sudo mode):

sshd -T | grep ciphers | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|[email protected]\)\,\?//g" >> /etc/ssh/sshd_config

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server, hard-code the following in /etc/ssh/sshd_config

ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

OR if you prefer not to dictate ciphers but merely want to strip out insecure ciphers, run this on the command line instead (in sudo mode):

sshd -T | grep ciphers | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|[email protected]\)\,\?//g" >> /etc/ssh/sshd_config

You can check ciphers currently used by your server with:

sudo sshd -T | grep ciphers | perl -pe 's/,/\n/g' | sort -u

Make sure your ssh client can use these ciphers, run

ssh -Q cipher | sort -u

to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

added a solution that seems more future-proofed and less prescriptive.
Source Link

To disable RC4 and use secure ciphers on SSH server set, hard-code the following in /etc/ssh/sshd_config

Ciphersciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

OR if you prefer not to dictate ciphers but merely want to strip out insecure ciphers, run this on the command line instead (in sudo mode):

sshd -T | grep ciphers | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|[email protected]\)\,\?//g" >> /etc/ssh/sshd_config

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    Ciphersciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server set the following in /etc/ssh/sshd_config

Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server, hard-code the following in /etc/ssh/sshd_config

ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

OR if you prefer not to dictate ciphers but merely want to strip out insecure ciphers, run this on the command line instead (in sudo mode):

sshd -T | grep ciphers | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|[email protected]\)\,\?//g" >> /etc/ssh/sshd_config

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

added config verification instructions
Source Link
savageBum
  • 599
  • 3
  • 5

To disable RC4 and use secure ciphers on SSH server set the following in /etc/ssh/sshd_config

Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct youyour SSH Clientclient to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server set the following in /etc/ssh/sshd_config

Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct you SSH Client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

To disable RC4 and use secure ciphers on SSH server set the following in /etc/ssh/sshd_config

Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

You can check ciphers currently used by your server with:

sudo sshd -T |grep ciphers

Make sure your ssh client can use these ciphers, run ssh -Q cipher to see the list.

You can also instruct your SSH client to negotiate only secure ciphers with remote servers. In /etc/ssh/ssh_config set:

Host *
    Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

Above snippets come from here
To test your server's settings you can use ssh-audit

Source Link
savageBum
  • 599
  • 3
  • 5
Loading