Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is a duplicate of one in StackOverflow, and I was recommended to ask this question here instead. My apologies if the multi-post is undesirable.

I have a very strange issue with FTP that is bugging the living daylights out of me. This is the FIRST time I have ever seen this issue.

When I upload a file, it does not overwrite the original, but instead gets renamed as [original file.ext].1 (or [file].2, if [file].1 already exists). For example, if style.css exist on the server, and I download and edit it, when I upload it back into position it gets “renamed” as style.css.1. Doing the attempt a second time produces a third file called style.css.2.

I own my own iron, upon which I have OpenSUSE 11.4 64-bit installed (a relatively recent install, just configured). I am making use of pure-ftpd and use the YAST control panel to manipulate the settings. The Umask (umask files:umask dirs) setting in particular is set to 000:000 (the only setting which will give an uploaded file the same permissions as existing files). I have Chrooted ftp access for everyone, and in order for FTP to access /srv/www/, I have used the instructions on this site to mount /srv/www/ inside /home/[user]/ftp/ using the bind operation. Ergo, FTP access is chrooted for a very secure user, but the user still has access to content within /srv/www/.

I have also taken the time to give the contents of /srv/www/ the same permissions and user:group as the user itself (i.e., there should be NO permissions issues).

I am using WS_FTP Pro 2007 to access the site, as well as Notepad++ (via NppFTP), and both clients have the same problem: I can download files just fine, but when I upload them they have “.#” appended to them (.1, .2, .3, etc.) instead of overwriting the original file. These new files have the IDENTICAL permissions and ownership (user:group) as the original file, so I am totally in the dark as to why the upload creates a new file instead of overwriting.

Edited to add: I have since tried several different FTP clients, including the FTP functionality in the Windows command line, with identical end results.

share|improve this question
This is probably a common occurrence with FTP software - consider, for example, you had FTP access to important-file.txt, and some script kiddy broke in and overwrote it with a blank text file. My advice: write a cron job to rename any of these files, and run it every 5 minutes. Shouldn't be too difficult if you are semi-competent with shell scripts. – new123456 Sep 7 '11 at 20:29
@new123456 - I have run FTP servers on a number of boxes, prior to this setup of OpenSUSE 11.4. NONE of them have exhibited this particular behaviour. I would prefer to utilize a clean and elegant solution, not some cron-job hack. – René Kåbis Sep 8 '11 at 1:18
up vote 1 down vote accepted

There are several references to an "autorename" feature in pure-ftpd. Is it just a matter of turning it off?

And while the file name descriptions make this seem less likely is the ftp client using the STOU option?

There may also be some help in this Q+A How do FTP servers handle rename to an existing file?

share|improve this answer
you got me looking in the right direction, although it took quite some time to figure this one out. To others that are using OpenSUSE or pure-ftpd along with the YAST control panel, be aware that the YAST control panel does NOT provide you with this option to edit. – René Kåbis Sep 8 '11 at 4:48
What I did (in my case) was to examine /etc/rc.d/pure-ftpd file, which contained within it a reference to /etc/pure-ftpd/pure-ftpd.conf. Within this second file, I found the entry AutoRename with a value of yes. I changed that to no, restarted pure-ftpd, and everything was running perfectly. Uploaded files do NOT get appended with a .# anymore. Thanks @Dennis, for the push in the right direction! – René Kåbis Sep 8 '11 at 4:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .