0

I am trying to copy a file from VMS machine to Unix machine using SFTP.

I want to preserve the file permissions. Or atleast change them once I copy using sftp.

As options like "chmod","umask" and "put -P" are not allowed, What is the solution for this one ?

Many Thanks! ~Kedar

  • Log into the UNIX machine and set the permissions using SSH. The SFTP subsystem controls what permissions incoming files get and, AFAIK, those permissions are static and tightly controlled. – bishop Dec 09 '16 at 18:20
  • Thanks @bishop well, I need to change the permissions without ssh. It should be preserved or there should be a way to change them. Any inputs ? – Kedar S. Dixit Dec 09 '16 at 18:22
  • 1
    There is no way for you, the SFTP user, to change the permissions. It's just not allowed because it's a security risk for the server. (In general, do you think it's a good idea to trust a setuid executable a random visitor deposits as safe? Of course not. It's safest to assume the file is lethal and set permissions accordingly.) If you want all incoming files to have a particular permission, change the SFTP server configuration. – bishop Dec 09 '16 at 18:25
  • Thanks, I think I will have to just do sftp first and then do ssh and change the permissions. – Kedar S. Dixit Dec 09 '16 at 18:35
  • 1
    If you need to transfer a lot of files then you can transfer a single tar that preserves permissions, then SSH and untar. – bishop Dec 09 '16 at 18:36
  • 1
    Alternatively you can use a shared file system like NFS. – bishop Dec 09 '16 at 18:37

0 Answers0