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.

Recently I encountered a lack of diskspace problem on a SFTP server and I realised I have no idea how to check how much is left or even the total amount.

Does anyone know how to do this through an application like FileZilla or perhaps there is a command that can be used for this purpose?

Note that the server is hosted at a third party and I was hoping there was a way to answer this question without going through them.

Update:

I tried connecting via shell using both putty and cygwin ssh. Putty silently failed while cygwin gave me the following error message:

$ ssh [user]@[host] -i "[priv.key]"
Last login: Wed Aug 17 12:54:46 2011 from 195.204.103.176
Could not chdir to home directory /local00/ftproot/[user]: No such file or directory
/usr/local/sbin/scponlyc: No such file or directory
Connection to [host] closed.

Any ideas?

share|improve this question
    
Do you have shell access to the server? –  SvW Aug 17 '11 at 8:51
    
I tried connecting through PuTTy and SSH using the same user, host and private key but just as the authentication process starts the window closes. I'm not sure how to interpret this whether or not authentication failed or if i don't have shell access.. I can connect with the same login with FileZilla –  kjetilh Aug 17 '11 at 10:26
    
Please see my updated question –  kjetilh Aug 17 '11 at 11:02
1  
Well, as answered by mailq in this case you're done : there's no way to check in a scponly environment. –  François Feugeas Aug 17 '11 at 13:24
    
ok, thanks for the answer –  kjetilh Aug 17 '11 at 13:30
add comment

3 Answers

The scponly shell may allow quota command (if enabled). But it seems that you have scponly configured to support SFTP only, with shell access disallowed.

SFTP protocol allows checking disk space (contrary to what other answers say).

Extracting from SFTP - check free space available question of stackoverflow.com:

SFTP protocol version 6 lets one check available space (SSH_FXP_EXTENDED request name space-available). Most SSH/SFTP servers (notably OpenSSH, as the one the most widespread) support SFTP version 3 only though.

OpenSSH on the other hand supports statvfs@openssh.com proprietary extension.

The OpenSSH extension is supported by some SFTP clients. Obviously by OpenSSH client (df command). WinSCP also supports it (see Server and Protocol Information Dialog).

share|improve this answer
add comment
ssh <host> df -h

Will give you all of the necessary information, in the absence of things like disk quotas. If you don't have shell access (or some way of running commands, such as via PHP exec), then you can't check disk space, but then again, if you don't have shell, how can it be your responsibility to administer the server and manage disk space?

share|improve this answer
    
Well, it's not strictly my responsibility, but I've written some exporting/importing scripts regarding the SFTP server and I'm notified of the errors triggered. Ultimately we would like to adjust/rewrite the cleanup process but now I just want some more information –  kjetilh Aug 17 '11 at 10:30
add comment

With the SFTP command set there is no possibility to get the available size or the space used.

If you are able to SSH to the server (same host, user, password) you could issue a df -h to see the space available. Or a du -h in the folder to see the used space of the folder.

share|improve this answer
    
It's not true that SFTP does not allow getting disk usage. See my other answer. –  Martin Prikryl Dec 27 '13 at 12:32
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.