Compare commits
No commits in common. "be2aa79a374ce277914368b9c3c0655454cce34b" and "9ca6bed8f1406b7933e50e9940de55cc5b97eec5" have entirely different histories.
be2aa79a37
...
9ca6bed8f1
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Adapted from LinuxConfig.org
|
# Adapted from LinuxConfig.org
|
||||||
# GNU GPL v3.0+
|
# GNU GPL v3.0+
|
||||||
CMDS="bash mkdir touch mv rm ls grep cat vim"
|
CMDS="mkdir touch mv rm ls grep cat vim"
|
||||||
|
|
||||||
USER=$1
|
USER=$1
|
||||||
CMDS=($CMDS) # convert to array
|
CMDS=($CMDS) # convert to array
|
||||||
@ -36,7 +36,7 @@ mkdir -p $CHROOT$CHROOT # make new home dir
|
|||||||
|
|
||||||
SHELL=$(cat /etc/passwd | grep $USER | tr ":" "\n" | tail -n 1)
|
SHELL=$(cat /etc/passwd | grep $USER | tr ":" "\n" | tail -n 1)
|
||||||
if [ ! -f $CHROOT$SHELL ]; then
|
if [ ! -f $CHROOT$SHELL ]; then
|
||||||
echo "WARN: You didn't add the shell specified in /etc/passwd for \"$USER\": ($SHELL)"
|
echo "WARN: You didn't add the shell specified in /etc/passwd for $USER: ($SHELL)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ARCH amd64
|
# ARCH amd64
|
||||||
@ -50,3 +50,8 @@ if [ -f /lib/ld-linux.so.2 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl restart sshd
|
systemctl restart sshd
|
||||||
|
|
||||||
|
echo "NOTE: If you are using a shell that is NOT /bin/bash, you need to tell"
|
||||||
|
echo " chroot that by using: chroot $CHROOT {other shell path}"
|
||||||
|
echo ""
|
||||||
|
echo "Chroot jail is ready. To access it execute: chroot $CHROOT"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user