Raspberry Pi

How to fix slow SSH remote terminal with Raspberry Pi

SSH is an encrypted network technology that allows Raspberry Pi users to access the device from their laptop or PC. It is handy for someone who needs remote access to a Raspberry Pi device as this will allow them to manage the device easily. However, the SSH remote terminal with Raspberry Pi often gets slow, creating a concern for the user to manage the device remotely.

In this article, we will let you know how you can fix the slow SSH remote terminal with Raspberry Pi. It will be helpful for those people who are facing the same issue.

How to fix slow SSH remote terminal with Raspberry Pi

SSHD is an OpenSSH server process for Linux-based systems and the same is the case for Raspberry Pi as well. It includes two main files for analysis which are as follows:

  • Configuration File
  • Service Logs

These two files are responsible for providing access to your Raspberry Pi terminal from a remote location. So, to fix the slow SSH remote terminal, we will need to make changes to these files.

1: Configuration File

The SSH configuration file includes various configuration options to set your SSH connection based on your preferences. To open this configuration file in the terminal, you must execute the below-given command.

$ sudo nano /etc/ssh/sshd_config

There you will see several options to configure your SSH connection. However, in this file, we will only do changes in a single parameter, “LogLevel” to increase the log verbosity so that we will get the detailed information of logs as the previous SSH service logs file “/var/log/auth.log” contains limited information. Scroll down and find the option “LogLevel INFO”, uncomment it and set it to the maximum level, DEBUG3. Save the file using the “Ctrl+X” keys when it is done.

After the changes, reboot your Raspberry Pi device and wait for the terminal to get slow. If it gets slow, open the Raspberry Pi terminal and check the SSH service log file using the following command.

$ sudo nano /var/log/auth.log

There, you will find the detailed log information of your SSH connection.

There are some rows where you will find PAM (Privileged Access Management) log-sessions which might be the reason for the slow SSH remote terminal. So, you will need to edit the PAM configuration files using the below-given command.

$ sudo nano /etc/pam.d/common-session

In the file, you will be able to find some package modules as well as two optional modules which are introduced for low Raspberry Pi models.

You can comment on these modules and use your device for a while then check whether it solves the problem. If the problem still occurs, go with the second method.

2: Service Logs

Some users may experience slow SSH remote terminal because of reverse DNS queries. The reason is that the SSH connection is made over the internet and the SSH daemon has the authority to check whether the client it is communicating with remains the same during the entire connection. This may result in the daemon periodically checking the client IP address or hostname by adding the reverse DNS queries, which may slow down your SSH connection. This won’t cause much trouble when the client belongs to the same network.

To avoid encountering the DNS queries, you can disable the DNS from the following configuration file.

$ sudo nano /etc/ssh/sshd_config

Scroll down and find the option “UseDNS no”.

Uncomment the option and save the file.

Reboot the device and hopefully this time, you won’t experience slow SSH remote terminal with your Raspberry Pi.


The Raspberry Pi is a pretty useful little device that enables users to access the device from a remote location using the SSH service. However, the user may experience a slow SSH remote terminal with Raspberry Pi, which needs solutions to fix it. The above methods will guide you in sorting out the slow SSH problem within a few minutes so that you will experience a fast remote terminal session with your Raspberry Pi device.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.