Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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.

See: http://linux.die.net/man/5/limits.conf

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 'someLargeGBFile.zip' | ssh myUsername@yourhost.com cat > MyNewFileOnYourServer.zip 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
add comment

Your Answer

 
discard

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.