mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
sftp chroot hotfixes
This commit is contained in:
parent
c8d45ed139
commit
73b63016d4
2 changed files with 10 additions and 5 deletions
|
@ -22,7 +22,7 @@ source $VESTA/conf/vesta.conf
|
|||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'USER'
|
||||
validate_format 'user'
|
||||
is_format_valid 'user'
|
||||
if [ -z "$SFTPJAIL_KEY" ]; then
|
||||
exit
|
||||
fi
|
||||
|
@ -51,7 +51,7 @@ fi
|
|||
usermod -a -G sftp-only $user
|
||||
|
||||
# Mouting home directory
|
||||
if [ -z "$(mount |grep $home)" ]; then
|
||||
if [ -z "$(mount |grep /chroot/$user/$home)" ]; then
|
||||
mount -o bind $home /chroot/$user/$home/
|
||||
fi
|
||||
|
||||
|
@ -61,6 +61,6 @@ fi
|
|||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
#log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
|
|
|
@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
|
|||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'USER'
|
||||
validate_format 'user'
|
||||
is_format_valid 'user'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
if [ "$user" = 'admin' ]; then
|
||||
|
@ -89,6 +89,11 @@ fi
|
|||
sed -i "/ $user$/d" $VESTA/data/queue/disk.pipe
|
||||
sed -i "/ $user$/d" $VESTA/data/queue/traffic.pipe
|
||||
|
||||
# Deleting sftp jail
|
||||
if [ ! -z "$SFTPJAIL_KEY" ]; then
|
||||
$BIN/v-delete-user-sftp-jail $user
|
||||
fi
|
||||
|
||||
# Deleting system user
|
||||
/usr/sbin/userdel -f $user >> /dev/null 2>&1
|
||||
|
||||
|
@ -122,6 +127,6 @@ fi
|
|||
|
||||
# Logging
|
||||
log_history "deleted system user $user" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue