running the server with limited privileges

Please post here if you have problems in using Wing FTP Server.
Post Reply
emes314
Posts: 4
Joined: Thu Sep 25, 2025 11:52 am

running the server with limited privileges

Post 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
FTP
Site Admin
Posts: 2158
Joined: Tue Sep 29, 2009 6:09 am

Re: running the server with limited privileges

Post 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
emes314
Posts: 4
Joined: Thu Sep 25, 2025 11:52 am

Re: running the server with limited privileges

Post 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.
FTP
Site Admin
Posts: 2158
Joined: Tue Sep 29, 2009 6:09 am

Re: running the server with limited privileges

Post by FTP »

Do you mean you can see the login page but can't login?
emes314
Posts: 4
Joined: Thu Sep 25, 2025 11:52 am

Re: running the server with limited privileges

Post by emes314 »

I can enter my username and password, but when I press the login button, the login screen reappears.
FTP
Site Admin
Posts: 2158
Joined: Tue Sep 29, 2009 6:09 am

Re: running the server with limited privileges

Post by FTP »

Please contact us via email, thanks!
emes314
Posts: 4
Joined: Thu Sep 25, 2025 11:52 am

Re: running the server with limited privileges

Post 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
Post Reply