added sshd config rule
This commit is contained in:
parent
47bed9ba2f
commit
50525dc124
@ -4,15 +4,16 @@
|
|||||||
CMDS="mkdir touch mv rm ls grep cat vim"
|
CMDS="mkdir touch mv rm ls grep cat vim"
|
||||||
|
|
||||||
USER=$1
|
USER=$1
|
||||||
|
CHROOT=$(eval echo ~$USER)
|
||||||
|
CMDS=($CMDS) # convert to array
|
||||||
|
|
||||||
if ! id "$USER" 2&>/dev/null; then
|
if ! id "$USER" 2&>/dev/null; then
|
||||||
echo 'INFO: User not found'
|
echo 'INFO: User not found'
|
||||||
echo 'Creating...'
|
echo 'Creating...'
|
||||||
useradd -m $USER
|
useradd -m $USER
|
||||||
|
printf "Match User $USER\n ChrootDirectory $CHROOT$CHROOT" >> /etc/ssh/sshd_config.d/70-$USER.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CHROOT=$(eval echo ~$USER)
|
|
||||||
CMDS=($CMDS) # convert to array
|
|
||||||
|
|
||||||
# cp in all commands and dependencies
|
# cp in all commands and dependencies
|
||||||
for cmd in "${CMDS[@]}"; do
|
for cmd in "${CMDS[@]}"; do
|
||||||
for dep in $( ldd $(which $cmd) | grep -v dynamic | cut -d " " -f 3 | sed 's/://' | sort | uniq ); do
|
for dep in $( ldd $(which $cmd) | grep -v dynamic | cut -d " " -f 3 | sed 's/://' | sort | uniq ); do
|
||||||
|
Loading…
Reference in New Issue
Block a user