V-restore-user ftp accounts

Hi,
If I have a user with a “_” sign in it, like user_1, my FTP accounts are created as user_1_ftp. When I restore the user with v-restore-user, my FTP accounts are changed to user_1_ftp_ftp.

I think it is because of the codes in
hestiacp/bin/v-restore-user

# Converting FTP users
if [ -n "$FTP_USER" ]; then
FTP_USER=$(echo "$FTP_USER" | sed -e "s/${old_user}_//")
FTP_USER="${user}_${FTP_USER}"
fi

in Github. Its my first head post. Sorry all my mistake. I get help from Google Translate. I wish you a healthy day.

Hi @hamzakasirga,

I’ve tested it and I’ve been able to reproduce it.

For example, user_1 has an ftp account user_1_ftp, when you restore the user, Hestia will create the ftp account user_1_1_ftp

Please, as root, apply this fix to rebuild.sh:

sed -Ei 's/ftp_user#\*/ftp_user##\*/' /usr/local/hestia/func/rebuild.sh

Once done, delete the user and try to restore it again. If you confirm that this fix is working I’ll open a PR in GitHub.

Thank you for your answer @sahsanu
I removed the ‘_’ sign from all my users and recreated the users. I wrote it here because I didn’t know how to suggest changes on Github.
Greetings

1 Like

Ok, anyway, I’ve created this pull request to fix the issue:

3 Likes