"sftp -r remotedir ." creates directories with wrong permissions

Bug #1030534 reported by Dan Kegel
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)

Bug Description

The local directories created by
   sftp -r remotedir .
are unreadable by anybody, so when it tries to create anything in them, it fails. Example:

$ sftp -r <email address hidden>:foo foo
<email address hidden>'s password:
Connected to host.com.
Fetching /foo/ to foo
Retrieving /foo
Retrieving /foo/www
mkdir foo/www: Permission denied

This is with Ubuntu 12.04, openssh-client 1:5.9p1-5ubuntu1

This is the second time I've ever used sftp.

Tags: precise
Revision history for this message
RoyK (roysk) wrote :

As far as I can see. it works well when I test on this Ubuntu 12.04 x86_64 machine. You may want to use -p or -P to get the permissions right. See man sftp…


Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Failed to reproduce on 12.04. I created a remote directory structure and copied it to local using "sftp -r" and it worked fine.

Dan, please could you report what the permissions and ownership were on the remote directories, what the permissions have ended up on your local directories, and what your local umask is? Please also confirm that you're doing this on a fresh local copy (ie. directories and files did not previously exist locally).

Setting bug status to Incomplete. Once you have have supplied the requested information, please change the status back to New.

Changed in openssh (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for openssh (Ubuntu) because there has been no activity for 60 days.]

Changed in openssh (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Michael Mess (michael-michaelmess) wrote :

I was able to reproduce it with a broken remote site that reports its files have no permission at all.

Remote permissions are applied to local directories before its content is downloaded. Thus local files could not be created.

tags: added: precise
Changed in openssh (Ubuntu):
status: Expired → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.