1

we are trying to copy files from one server to another but the permissions of copied files are not correct. I have tried following solution but its not working.

http://linuxshellaccount.blogspot.com/2007/11/setting-basic-file-permissions-in-non.html

currently permission is set to : -rw------- We want to change the permissions to -rw-rw-r—

Any one faced this issue ?

EDIT: We have Unix on both the sides.

5 Answers5

3

Use the "-p" flag to preserve permissions when copying with SCP.

Source: http://amath.colorado.edu/computing/software/man/scp.html

danlefree
  • 2,923
  • 1
  • 19
  • 20
2

I've set this with a chmod after the copy.

scp /path/to/file server:/path/to/file
ssh server chmod 664 /path/to/file
user50681
  • 52
  • 1
2

Check your umask on the remote side. I'll bet it looks like 077.

Bill Weiss
  • 10,979
  • 3
  • 38
  • 66
1

If you run WinSCP, there's an option set perms after the upload. Other than that, I believe that the only thing you can do is to chmod after the upload.

NinjaCat
  • 576
  • 1
  • 9
  • 21
  • @NinjaCat: actually same thing is working in many other production env. I don't know why in that env its not working. –  Aug 05 '10 at 16:45
0

You could try something more advanced like rsync, perhaps it has the needed options.

  • thanks for response but i cant :(. we have same thing working in many env and I cant change it. –  Aug 05 '10 at 16:45