LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-12-2015, 05:25 AM   #1
Katlinux
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Rep: Reputation: Disabled
Weird FTP issue : uploads to wrong folder


I am running a Centos VPS for development purposes.

I have setup vsftpd on the server so that the root user can ftp in externally (other machines/IP's)

Using FileZilla on a windows machine, i can FTP into the server fine using the root account.

However when using an application that uses Curl to create a connection to the server, the files are being uploaded to the wrong directory.


For example the files should be getting uploaded to: var/www/html/public/myfolder

however when the application uploads files, the files get saved in: root/var/www/html/public/myfolder

I have checked logs and the application is definitely creating a connection to the right folder (var/www/html/public/myfolder)

Is there a reason why it would be saving it to root/var/www/html/public/myfolder instead?
 
Old 11-12-2015, 05:46 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Usually, the home directory of root is /root. If you log on as root and copy a file to var/www/html/public/myfolder, it ends up in /root/var/www/html/public/myfolder.
 
Old 11-12-2015, 10:13 AM   #3
serverpoint.com
Member
 
Registered: Oct 2015
Posts: 52

Rep: Reputation: 6
Are we able to do change directory over ftp?
 
Old 11-12-2015, 10:25 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
n/m. No caffeine reply.
 
Old 11-12-2015, 10:43 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Katlinux View Post
For example the files should be getting uploaded to: var/www/html/public/myfolder

however when the application uploads files, the files get saved in: root/var/www/html/public/myfolder
without the leading / in var/www/html/public/myfolder it is going exactly where it should under the circumstance.
 
Old 11-12-2015, 02:45 PM   #6
Katlinux
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks guys, changing the home directory for root to var/www/html/public/myfolder solved it.
 
Old 11-12-2015, 02:52 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Katlinux View Post
Thanks guys, changing the home directory for root to var/www/html/public/myfolder solved it.
OMG. That is not a fix.
 
Old 11-12-2015, 03:01 PM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Katlinux View Post
Thanks guys, changing the home directory for root to var/www/html/public/myfolder solved it.
I can't imagine that you can change a home directory to a relative path.

I still wonder; you say:
Code:
the files should be getting uploaded to: var/www/html/public/myfolder
var/www/html/public/myfolder relative to which directory?
 
Old 11-12-2015, 03:01 PM   #9
Katlinux
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
without the leading / in var/www/html/public/myfolder it is going exactly where it should under the circumstance.
I did try it both ways. Same result.
 
Old 11-12-2015, 04:17 PM   #10
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Katlinux View Post
However when using an application that uses Curl to create a connection to the server, the files are being uploaded to the wrong directory.
Then fix the application!
 
Old 11-12-2015, 05:55 PM   #11
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
It is just painful to watch someone making remote connections using root account. When they learn root is local admin account only.
 
  


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
Why is SELinux blocking my FTP uploads? fakefake Linux - Server 26 10-13-2017 08:16 PM
How do I allow ftp uploads via windows explorer? NirvanaBaby Linux - Server 1 08-31-2011 01:32 AM
FTP uploads hang moodah Linux - Server 4 02-27-2011 11:16 PM
Is there an ftp program that allows for multi-thread ftp uploads ? Want faster upload brjoon1021 Linux - Software 4 02-04-2009 06:28 PM
ftp guest uploads simon Linux - Networking 2 08-09-2001 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:15 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