Server Fault is a question and answer site for system and network administrators. 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

Suppose if I want to limit each upload to be at 25 MB via SFTP, how can I make this possible? Do I add a line in /etc/ssh/sshd_config for that? I tried to look for this information via Google search but I couldn't find it at all.

share|improve this question

I don't think many sftpd packages support this by default, but I admit that I have not done exhaustive research. My recommendation would be to go beyond sftp and limit the max file size for a user on the system more generally.


username hard fsize 25000 Should be close to what you want. But I cannot guarantee the SFTP error message will be pretty.

The other thing to keep in mind is that if your sftp package is part of your ssh package, SFTP users usually have SSH access when they have sftp access. cat '' | ssh cat > May bypass any restrictions that are ONLY placed on the SFTP daemon.

share|improve this answer
You are right, I was perplexed by this too. I couldn't find anywhere that SFTP can support this at all. Therefore, I asked the client what he exactly mean by his request. He actually meant that he would like to have Wordpress to limit the upload file size to 25 MB. After a short research, I could easily configure php.ini and nginx.conf to set this limit. – crono15 Jul 22 '13 at 16:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.