LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2019, 09:54 PM   #1
frostfiretulsa
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Rep: Reputation: Disabled
FTP (vsftp) setup for apache user?


Hi Guys,

I have a CentOS install with a single website installed and working properly under /var/www/domainname/public_html

installed there is a copy of Invision Power Board, which has a new auto-update feature that uses a FTP connection to automatically install the updated files, etc.

The problem is the only FTP I have been able to set up is via my user account (lets call it user1), and that uploads by default to: /home/user1/ftp

Not only that, but after uploading those files I need to chown them to apache and chmod them as required by the forums, then set chcon for the selinux security etc before those files will be usable by apache.

So my question is, is there a way to set FTP up in such a way as to do all of that automatically for a specific user account to handle forum upgrades? If so, can someone kick me in the right direction please?

Cheers
 
Old 03-11-2019, 01:46 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,373
Blog Entries: 3

Rep: Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771
Quote:
Originally Posted by frostfiretulsa View Post
If so, can someone kick me in the right direction please?
FTP needs to be eliminated at this point in time. It's not the 1990s any more and there have been safer alternatives for decades.

So I'd say to use chrooted SFTP for the transfers with the starting directory %d pointing to where the files should go.

About setting the permissions on the uploaded files, instead of chown and chmod, you could use the SetGID bit for those directories or an ACL to apply the right group ownership.

Or you could instead run inotify and have an incron job watch the directory for new files and run a shell script to carry out the modifications you need. That works with small numbers of files coming in slowly.
 
1 members found this post helpful.
Old 03-11-2019, 07:24 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,788

Rep: Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001Reputation: 8001
Quote:
Originally Posted by frostfiretulsa View Post
Hi Guys,
I have a CentOS install with a single website installed and working properly under /var/www/domainname/public_html

installed there is a copy of Invision Power Board, which has a new auto-update feature that uses a FTP connection to automatically install the updated files, etc. The problem is the only FTP I have been able to set up is via my user account (lets call it user1), and that uploads by default to: /home/user1/ftp

Not only that, but after uploading those files I need to chown them to apache and chmod them as required by the forums, then set chcon for the selinux security etc before those files will be usable by apache.

So my question is, is there a way to set FTP up in such a way as to do all of that automatically for a specific user account to handle forum upgrades? If so, can someone kick me in the right direction please?
Aside from the spot-on advice Turbocapitalist gave you, I'll offer up one more bit of direction: do it like you're doing it now. Circumventing security, uploading directly to the webservers root, etc., are *NOT* good things. Transfer the file(s) to a temp directory under user1 home, and move them to production from there. Also, consider using something like SVN or Git so you can version these files, and roll back if necessary.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Setup FTP server using VsFtp and Configure Secure FTP connections on Ubuntu 14.04 Server LXer Syndicated Linux News 0 08-20-2014 07:00 PM
User Acvite Directory want logon FTP server Ubuntu (VSFTP) MrLike Linux - Server 2 04-24-2012 08:45 PM
FTP user level access questions - VSFTP jonty_11 Linux - Software 1 04-08-2011 02:40 PM
Questions about FTP over SSL: Apache or VSFTP? Mutually exclusive implementations? jamspunk Ubuntu 0 12-04-2008 09:46 AM
vsftp user setup kubicon Linux - Networking 7 01-29-2004 05:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration