mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 13:24:24 -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)
|
shell_path=$(grep -w "$shell" /etc/shells | head -n1)
|
||||||
|
|
||||||
# Changing passwd file
|
# 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)
|
shell=$(basename $shell_path)
|
||||||
|
|
||||||
# Adding jailed sftp env
|
# Adding jailed sftp env
|
||||||
if [ ! -z "$SFTPJAIL_KEY" ]; then
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue