Celeb Glow
general | March 20, 2026

History and autocompletion do not work in SSH PAM session (openssh-server, libpam-ldap and nscd)

I configured a Linux Ubuntu 20.04 LTS VM, to authenticate users in the LDAP base and it worked correctly, however, when trying to repeat commands already executed, as we normally do in Linux, pressing the "up arrow" key, the commands are not displayed, and gives the following error:

$ ^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A

The auto-complete function does not work either.

Has anyone been through this or could you help me with this question?

6

1 Answer

Probably the user's default shell is set to /bin/sh instead of a more full-featured interactive shell such as /bin/bash, as disussed here:

Arrow keys, Home, End, tab-complete keys not working in shell

If your (local) system have the nslcd-utils package, there should be a chsh.ldap command for this, equivalent to the chsh command for local users. If not, you may need to talk to the LDAP administrator.

As a last resort, you can always edit your existing default shell's startup file, for example ~/.profile, to replace itself with a shell of your choice (exec /bin/bash). Just be careful not to end up in an infinite loop - in particular don't exec a bash login shell from ~/.profile unless you also have a ~/.bash_profile.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy