0

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?

AEM
  • 1,166
  • 1
    Probably the user's default shell is set to /bin/sh instead of a more full-featured interactive shell such as /bin/bash - you will need to set that in the LDAP database – steeldriver Jun 02 '21 at 20:08
  • ... see related Arrow keys, Home, End, tab-complete keys not working in shell but note that the solution will be different (perhaps using chsh.ldap) – steeldriver Jun 02 '21 at 22:20
  • Good morning and thanks for your help! When you say that I need to set the interactive shell on the LDAP database, do you mean that it must be changed on the LDAP server instead of this change being done on the Linux server that receives the SSH connections? – Marcos Santos Jun 04 '21 at 14:43
  • I also think it's the question of the default shell being /bin/sh, but I couldn't figure out where to change that default. As it is a PAM authentication, I checked all the files in the /etc/pam.d/ folder, but I didn't find anything related. – Marcos Santos Jun 04 '21 at 14:43
  • Interestingly, users authenticated using LDAP are not stored in the /etc/passwd file and I could not find where they are stored (if they are stored anywhere). – Marcos Santos Jun 04 '21 at 14:43
  • I have added some suggestions below – steeldriver Jun 04 '21 at 15:05

1 Answers1

1

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.

steeldriver
  • 136,215
  • 21
  • 243
  • 336