Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Are there any limitations on SFTP that prevents a user from copying between filesystems? I have a SLES with SFTP, and users can't copy/move files between filesystems, even when the target is chmod 777-ed and the user is root -- Filezilla just says "failed". Creating a directory on the target filesystem works fine, as does copying/moving within a filesystem, and if the user SSHes in they can copy to the target filesystem no problem.

There's no SELinux, AppArmor, grsecurity, etc. What could be the problem?

UPDATE: the server is a SLES 10.4

share|improve this question
    
Have you set up SFTP correctly on the remote server? It requires some configuration. –  ire_and_curses Nov 2 '12 at 17:47
    
This could also be a firewall problem (like I myself have at the office). However, AFAIK SFTP is inherently insecure, and if you have the possibility to use scp instead, you probably should set that up (I don't know whether Filezilla supports SCP, but WinSCP is an alternative in case it doesn't). –  Axel Nov 2 '12 at 18:31
    
Can you please describe why could SFTP be insecure?? - afaik it's not a firewall problem, because SFTP uses encryption, thus it doesn't differ on firewall side to move a file between filesystems or not. –  gasko peter Nov 2 '12 at 18:35
    
Forget about the second part of my previous comment, I mixed it up... –  Axel Nov 2 '12 at 18:35
    
@gaskopeter: Sorry, as for the insecurity, I confused it with FTPS. As for the firewall comment: Have a look at the section "SFTP proxy" in en.wikipedia.org/wiki/SSH_File_Transfer_Protocol. I have a similar problem in office when connecting to a specific server and think our IT security department might have something like that set up because I can SFTP to/from other servers, but from that one machine, every transfer fails to my local machine. But it works if I connect over UMTS. –  Axel Nov 2 '12 at 18:48
add comment

2 Answers

up vote 4 down vote accepted

SFTP doesn't have a command to move files, only a rename command. In OpenSSH (the de facto standard implementation), this is implemented with the rename system call, which moves a file inside a filesystem. There is no command that can move a file to an arbitrary location, nor is there a command to copy a remote file to another remote location.

With only SFTP access and not shell access, the only way to copy a file is to download and reupload it. You can create symbolic links.

share|improve this answer
    
you are right. via SFTP no one can move files (I mean between filesystems..) –  gasko peter Nov 5 '12 at 8:33
add comment

The target filesystem may be read-only or otherwise not allowing writes by the SFTP user (e.g. a FUSE mount by another user with allow_other not set, etc). Login to the target machine as the SFTP user (using su - username, for example) and make sure you can create files. You may also use a CLI client like sftp that may give you more useful information when you encounter errors.

share|improve this answer
    
"and if the user SSHes in they can copy to the target filesystem no problem." –  gasko peter Nov 2 '12 at 19:22
    
"sftp client" has a debug mode, we may try it out –  gasko peter Nov 2 '12 at 19:23
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.