HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

SCP permission for incoming files

 
SOLVED
Go to solution
Ahmed_58
Regular Advisor

SCP permission for incoming files

Hi All,
While SCP a file in one of our server we are facing permission problem, when I try to get a file from other server through SCP the file permission is 7000 but we want 644. where I have to change the permission for incoming file? the umask value is my .profile is 022. Please guide me to solve the problem.

Regards,
Ahmed
6 REPLIES
Steven Schweda
Honored Contributor

Re: SCP permission for incoming files

> [...] one of our server [...]

Not a very detailed description of anything.

uname -a
ssh -V

> While SCP a file [...]

As usual, showing an actual command with its
actual output can be more helpful than vague
descriptions or interpretations.

What are the permissions of the file on its
source system?

ls -l

> Please guide me to solve the problem.

Please show what you're doing, on what.
rariasn
Honored Contributor
Solution

Re: SCP permission for incoming files

Hi Ahmed:


Have a look at the 'SftpUmask' parameter in the sshd_config file. On my HP-UX server the file is /etc/opt/ssh/sshd_config.

If you specify:

SftpUmask 007

in the sshd_config file and then stop and restart the SSH daemon, I think this should do what you want.

Have a look at the sshd_config man page for more details.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1410258


rgs,
Bill Hassell
Honored Contributor

Re: SCP permission for incoming files

> the file permission is 7000...

Are you saying that the ll command shows something like this:

---S--S--- 1 blh users 0 Dec 30 10:13 abc

Or did you mean that the mode is 700 and looks like this:

-rwx------ 1 blh users 0 Dec 30 10:13 abc

Is the file mode correct on your local system correct (ie, 644). The use the -p option with scp to preserve the mode:

scp -p myfile remoteserver:/somedirectory

Otherwise, use the option in sshd.conf on the remote server to set the default mode.


Bill Hassell, sysadmin
INH
Regular Advisor

Re: SCP permission for incoming files

Ahamed,

use scop -p option source destination

or

owner of the file is same as the user who deos scp? please check
Knowledge is power
Ahmed_58
Regular Advisor

Re: SCP permission for incoming files

dears thanks for your replay,,,,
dear rariasn,
I did a quick test with the change as you suggested and it looks working.

thanks.
INH
Regular Advisor

Re: SCP permission for incoming files

Ahamed,

My aplogies, small correction in my previous post scop=scp

use scp -p option source destination

or

owner of the file is same as the user who deos scp? please check
Knowledge is power