You are not logged in.

#1 2016-04-19 20:21:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Backspace key does not work in a ssh chroot jail

I setup a ssh chroot jail according to this guide.  It works as advertised with two exceptions:

1) The backspace key actually moves the cursor forward and does not delete what I type.
2) Logging in doesn't trigger an automatic sourcing of /.bashrc (which I copied from /etc/skel) or of /etc/inputrc.  What am I missing?

Here is the chroot jail:

% tree -a /var/jail
/var/jail
├── .bashrc
├── bin -> usr/bin
├── dev
│   ├── null
│   ├── random
│   ├── tty
│   └── zero
├── etc
│   ├── group
│   ├── inputrc
│   └── passwd
├── lib -> usr/lib
├── lib64 -> usr/lib64
└── usr
    ├── bin
    │   ├── bash
    │   ├── ls
    │   ├── scp
    ├── lib
    │   ├── libcap.so.2
    │   ├── libc.so.6
    │   ├── libdl.so.2
    │   ├── libncursesw.so.6
    │   ├── libnss3.so
    │   ├── libnssckbi-p11-kit.so
    │   ├── libnssckbi.so
    │   ├── libnss_compat-2.23.so
    │   ├── libnss_compat.so
    │   ├── libnss_compat.so.2
    │   ├── libnss_db-2.23.so
    │   ├── libnssdbm3.chk
    │   ├── libnssdbm3.so
    │   ├── libnss_db.so
    │   ├── libnss_db.so.2
    │   ├── libnss_dns-2.23.so
    │   ├── libnss_dns.so
    │   ├── libnss_dns.so.2
    │   ├── libnss_files-2.23.so
    │   ├── libnss_files.so
    │   ├── libnss_files.so.2
    │   ├── libnss_hesiod-2.23.so
    │   ├── libnss_hesiod.so
    │   ├── libnss_hesiod.so.2
    │   ├── libnss_myhostname.so.2
    │   ├── libnss_mymachines.so.2
    │   ├── libnss_nis-2.23.so
    │   ├── libnss_nisplus-2.23.so
    │   ├── libnss_nisplus.so
    │   ├── libnss_nisplus.so.2
    │   ├── libnss_nis.so
    │   ├── libnss_nis.so.2
    │   ├── libnss_resolve.so.2
    │   ├── libnsssysinit.so
    │   ├── libnssutil3.so
    │   ├── libnss_winbind.so
    │   ├── libnss_winbind.so.2
    │   ├── libnss_wins.so
    │   ├── libnss_wins.so.2
    │   └── libreadline.so.6
    └── lib64
        └── ld-linux-x86-64.so.2

Last edited by graysky (2016-04-19 21:56:12)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-04-19 21:41:46

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Backspace key does not work in a ssh chroot jail

I have never done something like this, so it is just a guess, check if adding /etc/shells to the chroot helps it to work.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2016-04-19 21:48:02

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Backspace key does not work in a ssh chroot jail

@Rookie - No effect... I did solve #2 by editing /etc/profile (within the chroot) to read:

# Source global bash config
if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && test -r /.bashrc; then
  . /.bashrc
fi

I still cannot figure out the backspace issue hmm

EDIT: From what I think I'm learning, readline does this... what component of readline might I require (to manually copy into the chroot jail)?

Last edited by graysky (2016-04-19 21:56:58)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2016-04-19 22:48:23

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Backspace key does not work in a ssh chroot jail

I might be misleading you so take this with a few grains of salt. I see you have included something related to ncurses (libncursesw.so.6) but you don't include any files from '/usr/share/terminfo'.

Maybe one of those files is needed and if not found things will not work correctly. Regarding readline, no ideas here.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB