Linux / UNIX: Speed up SSH X11 Forwarding

I‘ve an CentOS based server and Ubuntu based desktop pc. I’m connecting to my CentOS using ssh X11 forwarding feature. However, speed over the Internet is pretty slow for certain apps such as VMWare console. How do I speed up OpenSSH X11 forwarding using Linux / UNIX desktop system?

You need to use the following syntax to speed up SSH 11 forwarding:

ssh -X -C -c cipher1,cipher2


  • -X : Turn on SSH X11 forwarding
  • -C : Requests compression of all data. You can also specifies the compression level to use if compression is enabled using the CompressionLevel option in ssh_config file. The argument must be an integer from 1 (fast) to 9 (slow, best). The default level is 6, which is good for most applications.
  • -c : Set ciphers. Blowfish is a fast block cipher; it appears very secure and is much faster than 3des. (see sshd man page for more info).

In this example, connect to the ssh server called using vivek user and start firefox browser:
$ ssh -X -C -c blowfish-cbc,arcfour
[www544 ~] $ firefox &

You can avoid typing by editing /etc/ssh/ssh_config file as follows:

Cipher blowfish
# default line 
##Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
## see man page for more info on Ciphers 
Ciphers blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
Compression yes

Save and close the file. You can now simply connect it as follows:
$ ssh -X
[www544 ~] $ firefox &


  • man pages – ssh, ssh_config, sshd

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • yoander Jan 6, 2011 @ 17:27

    Hello vivek, Why OpenBSD logo?

  • Alex Jan 7, 2011 @ 8:19

    …since OpenSSH came from OpenBSD :)

  • Wizzy Apr 14, 2012 @ 9:17

    Just the second
    -C Requests compression of all data (including stdin, stdout, stderr, and data for forwarded X11 and TCP connections). The compression algorithm is the same
    used by gzip(1), and the “level” can be controlled by the CompressionLevel option for protocol version 1. Compression is desirable on modem lines and other
    slow connections, but will only slow down things on fast networks. The default value can be set on a host-by-host basis in the configuration files; see the
    Compression option.
    and this is I mean
    [quote]but will only slow down things on fast networks[/quote]

  • Jeevan Kadam Sep 23, 2013 @ 10:25

    I have used this command, but it doesn’t resolved my problem at expected level.
    I am trying to access my one of the development product which has huge configurations over the linux server. Whereas I am accessing it from my client Desktop by using X11 Forwarding option for its GUI development. What could be the another option to resolve the same or Does this required more bandwidth rate over network?

    Please suggest on the same.!


    • oldnixguy Oct 19, 2013 @ 9:44


      You can try NX (see, it really speeds things up and makes remote desktop sessions possible even on very slow lines (I could use it on a 56k phone line).

  • dimenwarper Nov 7, 2013 @ 18:14

    Works great! I find the cipher was the main thing slowing my connections, blowfish is much faster.

  • Alpha Dec 3, 2013 @ 8:15

    Hi I want to know how to make it under windows?

    I tried Xshell+Xming under windows 7

    but it’s very slow…

    I tried script below
    ssh -c arcfour,blowfish-cbc -XC username@host

    But when I use Xshell it’s always think “-c arcfour,blowfish-cbc -XC username” is my username!

    Is there any other way to make it faster?

  • datruche Oct 15, 2015 @ 16:06

    As Wizzy noted above, CompressionLevel is available for SSH1 only (unsecure). As one can read in the man page:
    [quote]CompressionLevel …..The meaning of the values is the same as in gzip(1). Note that this option applies to protocol version 1 only.[/quote]

    Also OpenSSH 6.7 (2014-10) and 7.0 deprecated a number of ciphers of which blowfish-cbc and arcfour* ( ). Check your client’s ssh config file, and your server’s in case you move files on LANs where security is less a concern.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum