Plesk: Backspace does not work in SSH Terminal (chroot)

A common issue you may face when working with an SSH terminal via user webspace in Plesk or SSH client (e.g. Putty) in a chrooted environment – /bin/bash (chrooted), is that the [BACKSPACE] key is not working correctly – when you press it, it just acts as a [SPACE] button.

Other symptoms you may face along with this bug:

  1. Cron Jobs which are added in the “Scheduled Tasks” section of the user webspace (in a chrooted environment) may fail to execute;
  2. Linux commands when copy-pasted in the SSH terminal sometimes get trimmed or produce an unexpected output;

How to fix the “no backspace in a chrooted shell environment” problem

Most probably something is wrong with the terminfo database or /etc/inputrc file in your chrooted shell environment template and these files need to be replaced with a fresh copies.

#1 First login to your Plesk server via SSH as a root user

#2. Next you need to download a script which will allow you to manage the chroot template (if you do not already have it). Execute these two linux commands to do so:

curl -o update-chroot.sh https://raw.githubusercontent.com/plesk/kb-scripts/master/update-chroot/update-chroot.sh
chmod 700 update-chroot.sh

#3 Copy the /etc/inputrc file which is responsible for handling the keyboard mapping in console-specific situations. Use this command (it will auto-confirm the overwrite of the old file):

  yes | cp /etc/inputrc /var/www/vhosts/chroot/etc/inputrc

#4 Copy the /usr/share/terminfo/ database over the version which is (or at least it should be) present in the chroot directory by using this command (it will auto-confirm the overwrite of the old directory and its files):

yes | cp -rf /usr/share/terminfo/ /var/www/vhosts/chroot/usr/share/

#5 Update the chroot template for all of your websites by using this command:

./update-chroot.sh --apply all

#6 Last step – Login back into a chrooted environment via “SSH Terminal” option in your PLESK webspace or SSH Client (such as Putty) and enjoy the changes! *If already logged in – logout and login again.

In case this solution does not work out for you, check the links down below.

References:

How to add programs to chrooted shell environment template in Plesk – Plesk Support
Backspace key doesn’t work when logged in chroot account – Plesk Forum

Leave a Comment on Plesk: Backspace does not work in SSH Terminal (chroot)
About the author
I'm a full-stack WordPress developer with a 10+ years of solid experience in the core web development languages, development processes / techniques, web security, Linux server management and with pretty good understanding about proper semantics, UX/UI, technical SEO, good design and basic knowledge of company leadership. On top of that - a distant 5+ years experience as a computer and electronics repair technician which often enables me to understand also how the things work at the hardware level.
Your feedback matters!…
I hope you found this article helpful. Feel free to add some comments - your feedback is very important to me, as it drives my motivation and helps me to improve the content.