Page 1 of 1
running the server with limited privileges
Posted: Thu Sep 25, 2025 11:56 am
by emes314
Hello,
I installed the server on linux (AlmaLinux 10)
I noticed that it runs with root privileges. Is it possible to run it with limited privileges? Nowadays, this should be standard practice.
Michal
Re: running the server with limited privileges
Posted: Sun Sep 28, 2025 4:18 pm
by FTP
OK, it is possible to start wftpserver as a non-root user, but non-root user can't bind to well-known ports (below 1024).
The solution is to use the following command (suppose WingFTP is installed under "/opt/wftpserver"):
setcap 'cap_net_bind_service=+ep' /opt/wftpserver/wftpserver
Re: running the server with limited privileges
Posted: Tue Sep 30, 2025 10:18 am
by emes314
I managed to run it as non-root.
Unfortunately, after creating a local FTP user account, I am unable to log in via http/https. Logging in via FTP works.
When the server is running as root, http/https login works.
Re: running the server with limited privileges
Posted: Tue Sep 30, 2025 2:16 pm
by FTP
Do you mean you can see the login page but can't login?
Re: running the server with limited privileges
Posted: Wed Oct 01, 2025 10:12 am
by emes314
I can enter my username and password, but when I press the login button, the login screen reappears.
Re: running the server with limited privileges
Posted: Wed Oct 01, 2025 10:27 am
by FTP
Please contact us via email, thanks!
Re: running the server with limited privileges
Posted: Thu Oct 02, 2025 6:54 am
by emes314
I solved the problem.
Generally speaking, the program is not designed to run as non-root. When first launched, it creates directories without access for the owner, and that is the main reason. First, I corrected the permissions for the Data and Log directories. Then I had to correct the permissions for the session directory.
Now the program works correctly.
I am sending you the corrected file to run via systemctl.
cat /etc/systemd/system/wftpserver.service
[Unit]
Description=Wing FTP Server
After=network.target
[Service]
Type=forking
User=wingftp
Group=wingftp
WorkingDirectory=/opt/wftpserver
ExecStart=/opt/wftpserver/wftpserver
PIDFile=/opt/wftpserver/pid-wftpserver.pid
Restart=on-failure
[Install]
WantedBy=multi-user.target