mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Correct shell setting when SFTP chroot is enabled
This commit is contained in:
parent
e892898874
commit
4b9cb6e424
1 changed files with 6 additions and 2 deletions
|
@ -36,12 +36,16 @@ is_object_unsuspended 'user' 'USER' "$user"
|
|||
shell_path=$(grep -w "$shell" /etc/shells | head -n1)
|
||||
|
||||
# Changing passwd file
|
||||
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
|
||||
/usr/bin/chsh -s "$shell_path" "$user" >/dev/null 2>&1
|
||||
shell=$(basename $shell_path)
|
||||
|
||||
# Adding jailed sftp env
|
||||
if [ ! -z "$SFTPJAIL_KEY" ]; then
|
||||
$BIN/v-add-user-sftp-jail $user
|
||||
if [[ "$shell" =~ nologin ]] || [[ "$shell" =~ rssh ]]; then
|
||||
$BIN/v-add-user-sftp-jail $user >/dev/null 2>&1
|
||||
else
|
||||
$BIN/v-delete-user-sftp-jail $user >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue