Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Users

Maintaining file permissions with sftp

 

 

OpenSSH users RSS feed   Index | Next | Previous | View Threaded


mrgreiner at gmail

Mar 11, 2011, 4:10 AM

Post #1 of 2 (1000 views)
Permalink
Maintaining file permissions with sftp

Hi,

when making a sftp file transfer, overwriting an existing file, is there
any way to preserve the permissions of the file? So, if the file had
permissions like 664, to preserve them instead of overwriting them with
any other permission.

Thank you,

Roberto

PS: System setup: server is running OpenSSH 5.1p1, from Debian packages,
clients are running windows versions of sftp

--
-----------------------------------------------------
Marcos Roberto Greiner

Os otimistas acham que estamos no melhor dos mundos
Os pessimistas tem medo de que isto seja verdade
James Branch Cabell
-----------------------------------------------------


tsilver at indiana

Mar 11, 2011, 10:35 AM

Post #2 of 2 (1030 views)
Permalink
Re: Maintaining file permissions with sftp [In reply to]

Roberto,

There's nothing in the sftp man page. My preference is to use rsync if you want to retain permissions. Use the -o and -g flags, or, -a but be aware that -a will perform a recursive sync if it finds a directory. Just check out the man page.

Tim

On Mar 11, 2011, at 7:10 AM, Roberto wrote:

> Hi,
>
> when making a sftp file transfer, overwriting an existing file, is there any way to preserve the permissions of the file? So, if the file had permissions like 664, to preserve them instead of overwriting them with any other permission.
>
> Thank you,
>
> Roberto
>
> PS: System setup: server is running OpenSSH 5.1p1, from Debian packages, clients are running windows versions of sftp
>
> --
> -----------------------------------------------------
> Marcos Roberto Greiner
>
> Os otimistas acham que estamos no melhor dos mundos
> Os pessimistas tem medo de que isto seja verdade
> James Branch Cabell
> -----------------------------------------------------
>

OpenSSH users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.