We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d7ae9ee + b05c27c commit 681eee0Copy full SHA for 681eee0
bin/v-add-user-sftp-jail
@@ -28,7 +28,13 @@ source_conf "$HESTIA/conf/hestia.conf"
28
29
check_args '1' "$#" 'USER'
30
is_format_valid 'user'
31
-is_object_valid 'user' 'USER' "$user" # Limit to only Hestia user(s)
+check=$(is_object_valid 'user' 'USER' "$user")
32
+if [ $? -ne 0 ]; then
33
+ user_str=$(grep "^$user:" /etc/passwd |egrep "rssh|nologin")
34
+ #try to detect "owner" of the ftp_user if not found dont set it up
35
+ user=$(echo $user_str | cut -f6 -d : | cut -f3 -d / )
36
+ is_object_valid 'user' 'USER' "$user"
37
+fi
38
user_str=$(grep "^$user:" /etc/passwd |egrep "rssh|nologin")
39
if [ -z "$user_str" ]; then
40
exit
0 commit comments