Update lastlog even on non interactive ssh (eg. with rsync)
This commit is contained in:
parent
985c72194a
commit
9606b23d97
5
bkctld
5
bkctld
|
@ -157,9 +157,11 @@ mk_jail() {
|
||||||
passwd="${TPLDIR}/passwd"
|
passwd="${TPLDIR}/passwd"
|
||||||
shadow="${TPLDIR}/shadow"
|
shadow="${TPLDIR}/shadow"
|
||||||
group="${TPLDIR}/group"
|
group="${TPLDIR}/group"
|
||||||
|
sshrc="${TPLDIR}/sshrc"
|
||||||
[ -f "${LOCALTPLDIR}/passwd" ] && passwd="${LOCALTPLDIR}/passwd"
|
[ -f "${LOCALTPLDIR}/passwd" ] && passwd="${LOCALTPLDIR}/passwd"
|
||||||
[ -f "${LOCALTPLDIR}/shadow" ] && shadow="${LOCALTPLDIR}/shadow"
|
[ -f "${LOCALTPLDIR}/shadow" ] && shadow="${LOCALTPLDIR}/shadow"
|
||||||
[ -f "${LOCALTPLDIR}/group" ] && group="${LOCALTPLDIR}/group"
|
[ -f "${LOCALTPLDIR}/group" ] && group="${LOCALTPLDIR}/group"
|
||||||
|
[ -f "${LOCALTPLDIR}/sshrc" ] && group="${LOCALTPLDIR}/sshrc"
|
||||||
umask 077
|
umask 077
|
||||||
|
|
||||||
echo "1 - Creating the chroot"
|
echo "1 - Creating the chroot"
|
||||||
|
@ -181,12 +183,13 @@ mk_jail() {
|
||||||
cp "$passwd" etc
|
cp "$passwd" etc
|
||||||
cp "$shadow" etc
|
cp "$shadow" etc
|
||||||
cp "$group" etc
|
cp "$group" etc
|
||||||
|
cp "$sshrc" etc/ssh
|
||||||
|
|
||||||
echo "3 - Copying binaries"
|
echo "3 - Copying binaries"
|
||||||
cp -f /lib/ld-linux.so.2 lib 2>/dev/null || cp -f /lib64/ld-linux-x86-64.so.2 lib64
|
cp -f /lib/ld-linux.so.2 lib 2>/dev/null || cp -f /lib64/ld-linux-x86-64.so.2 lib64
|
||||||
cp /lib/x86_64-linux-gnu/libnss* lib/x86_64-linux-gnu
|
cp /lib/x86_64-linux-gnu/libnss* lib/x86_64-linux-gnu
|
||||||
|
|
||||||
for dbin in /bin/sh /bin/ls /bin/mkdir /bin/cat /bin/rm /bin/sed /usr/bin/rsync /usr/sbin/sshd /usr/lib/openssh/sftp-server; do
|
for dbin in /bin/sh /bin/ls /bin/mkdir /bin/cat /bin/rm /bin/sed /usr/bin/rsync /usr/bin/lastlog /usr/sbin/sshd /usr/lib/openssh/sftp-server; do
|
||||||
cp -f $dbin ${JAILDIR}/${jail}/$dbin;
|
cp -f $dbin ${JAILDIR}/${jail}/$dbin;
|
||||||
for lib in $(ldd $dbin | grep -Eo "/.*so.[0-9\.]+"); do
|
for lib in $(ldd $dbin | grep -Eo "/.*so.[0-9\.]+"); do
|
||||||
cp -p $lib ${JAILDIR}/${jail}/$lib
|
cp -p $lib ${JAILDIR}/${jail}/$lib
|
||||||
|
|
Loading…
Reference in a new issue