Operating System - HP-UX
1833176 Members
3051 Online
110051 Solutions
New Discussion

file permission set while doing sftp

 
sathis kumar
Frequent Advisor

file permission set while doing sftp

Hello,

we are doing file transfer using sftp process from one HP-UX server to another HP-UX server.
We need some clarification on the file permission that will get set at the receiving end.

Sending end:

permission filename
-rwxrwxrwx(777) a
Umask set : 033

Receiving end:

-rwxr-x---(750) a
Umask set : 033

The requirement is, at the receiving end, the file should have permission like -rw-rw-rw- (666).
Could you please let me know how this can be done?
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: file permission set while doing sftp

>Receiving end: -rwxr-x---(750) a
>Umask set: 033

From your values and assuming 777 is copied over, umask seems to be 27.

You really should be starting out with 666 and not your 777.
sathis kumar
Frequent Advisor

Re: file permission set while doing sftp

If I send with
-rw-rw-rw- a
then the file gets delivered with
-rw-r----- a

I need to have 664 or 644 file permission at the receiving end.
Dennis Handly
Acclaimed Contributor

Re: file permission set while doing sftp

>I need to have 664 or 644 file permission at the receiving end.

Then of course your umask must be changed from 27 to 22.
Why don't you use this sftp command:
lumask umask: Set local umask to umask.