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