Add sftp user to access /var/www/html directory

#1
I want to add a sftp user to access /var/www/html directory only, without ssh login permission.Tried many tutorials available across internet but no one is working. However same method working on LAMP server but not working with litespeed installed vps.

Can anyone help in this, how you guys are creating ftp users?
 

Pong

Administrator
Staff member
#2
LiteSpeed has nothing to do with sftp and should not stop you to use sftp. It has nothing to do with LAMP either. purely sftp setup issue.
 

winkybil

Active Member
#3
HI, I know this may be a basic question but I am trying to understand what the best practices is with www sites and the file Kodi nox permissions.
 
Last edited:
#5
I want to add a sftp user to access /var/www/html directory only, without ssh login permission.Tried many tutorials available across internet but no one is working. However same method working on LAMP server but not working with litespeed installed vps.

Can anyone help in this, how you guys are creating ftp users?
I`m so frustrated after reading so many users in difficulty, and surprised about the fact that nobody is willing to provide proper explanations for the sake of 2 minutes and 5 lines...

The issue here is that for example on OpenLitespeed, the /var/www directory is owned by user nobody. As such, you need to create a virtual ftp user and change the owner whilst still leaving nobody to access it.

Assuming you are using Pure-FTP and PureDB enabled, create the user without SSH login first:

Bash:
useradd -d /var/www -s /sbin/nologin ftpuser && echo 'ftpuser:VERYSTRONGPASSWORD' | sudo chpasswd
Then create a Pure-FTP virtual user:

Bash:
pure-pw useradd storeftp -u ftpuser -d /var/www -m
Then rebuild the Pure-FTP database:

Bash:
pure-pw mkdb
And finally change the ownership:

Bash:
chown -R ftpuser:nobody /var/www/
Optionally update permissions too (if you cannot write to it):

Bash:
chmod -R 775 /var/www/
With the above you will be able to have FTP users accessing the /var/www without SSH login.
 

serpent_driver

Well-Known Member
#8
LSWS and OLS are just web servers, so why do ask for support for an issue that is not related to a web server? If you don't use a server control panel like cPanel or Plesk you need to study the related knowledge about how to administrate a Linux server.
 
#9
LSWS and OLS are just web servers, so why do ask for support for an issue that is not related to a web server? If you don't use a server control panel like cPanel or Plesk you need to study the related knowledge about how to administrate a Linux server.
And you are addressing this to me for what reason? I answered the OP's question, since nobody was willing to in 3 years time. And FYI, I have several control panels. And to conclude, stop being so toxic. I can smell the reek of toxicity virtually.
 
Top