Compare commits
	
		
			2 Commits
		
	
	
		
			9ca6bed8f1
			...
			be2aa79a37
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| be2aa79a37 | |||
| ad58d4f3cd | 
@@ -1,7 +1,7 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
# Adapted from LinuxConfig.org 
 | 
			
		||||
# GNU GPL v3.0+
 | 
			
		||||
CMDS="mkdir touch mv rm ls grep cat vim"
 | 
			
		||||
CMDS="bash mkdir touch mv rm ls grep cat vim"
 | 
			
		||||
 | 
			
		||||
USER=$1
 | 
			
		||||
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)
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
# ARCH amd64
 | 
			
		||||
@@ -50,8 +50,3 @@ if [ -f  /lib/ld-linux.so.2 ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user