public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* when I try to open file with another user on CYGWIN , I get access denied message
@ 2017-05-16  9:15 Alex
  2017-05-16 11:31 ` Dan Kegel
  2017-05-16 17:12 ` Brian Inglis
  0 siblings, 2 replies; 12+ messages in thread
From: Alex @ 2017-05-16  9:15 UTC (permalink / raw)
  To: cygwin

I have windows 2008 server and external partner requested me to install 
CGYWIN on it so they can send a file to via SSH. I created a domain user 
called test1 and they sent me the public key and installed home folder. 
They can send the file without any problem. I can able to read and 
delete if I login to windows server with test1 username.

My problem is I can not open that files with another username. I have a 
username call test2 and I need to login to windows server with this 
username and run the script to import the files from test1 folder. I got 
access denied message when I try to open it.

file permission show ;

-rwx------

I changed the umask in profile to 002 , but did not fix the problem.

Any idea?

By the way I have a little knowledge of linux

thank

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16  9:15 when I try to open file with another user on CYGWIN , I get access denied message Alex
@ 2017-05-16 11:31 ` Dan Kegel
  2017-05-16 14:59   ` Alex
  2017-05-16 17:12 ` Brian Inglis
  1 sibling, 1 reply; 12+ messages in thread
From: Dan Kegel @ 2017-05-16 11:31 UTC (permalink / raw)
  To: cygwin

Did you try
   chmod 755 foo.dat
on the file (assuming it's named foo.dat)?

umask 002 would have done that for you if you'd done it before
creating the file.

It's a bit odd to have +x set on a data file, so if it's not a dll or
exe, you might
want to make it chmod 644 instead.
- Dan


On Tue, May 16, 2017 at 1:12 AM, Alex <lombak@gmx.com> wrote:
> I have windows 2008 server and external partner requested me to install
> CGYWIN on it so they can send a file to via SSH. I created a domain user
> called test1 and they sent me the public key and installed home folder. They
> can send the file without any problem. I can able to read and delete if I
> login to windows server with test1 username.
>
> My problem is I can not open that files with another username. I have a
> username call test2 and I need to login to windows server with this username
> and run the script to import the files from test1 folder. I got access
> denied message when I try to open it.
>
> file permission show ;
>
> -rwx------
>
> I changed the umask in profile to 002 , but did not fix the problem.
>
> Any idea?
>
> By the way I have a little knowledge of linux
>
> thank
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 11:31 ` Dan Kegel
@ 2017-05-16 14:59   ` Alex
  2017-05-16 15:22     ` cyg Simple
  2017-05-16 19:14     ` Dan Kegel
  0 siblings, 2 replies; 12+ messages in thread
From: Alex @ 2017-05-16 14:59 UTC (permalink / raw)
  To: cygwin

Yes I did , but I can access only the current files. If they send new 
file next time, it won't get this setup so not possible to open.


I need something like folder permission and will apply to all files in 
it also must be apply to files   will be created latter

thanks



On 16/05/2017 14:10, Dan Kegel wrote:
> Did you try
>     chmod 755 foo.dat
> on the file (assuming it's named foo.dat)?
> 
> umask 002 would have done that for you if you'd done it before
> creating the file.
> 
> It's a bit odd to have +x set on a data file, so if it's not a dll or
> exe, you might
> want to make it chmod 644 instead.
> - Dan
> 
> 
> On Tue, May 16, 2017 at 1:12 AM, Alex <lombak@gmx.com> wrote:
>> I have windows 2008 server and external partner requested me to install
>> CGYWIN on it so they can send a file to via SSH. I created a domain user
>> called test1 and they sent me the public key and installed home folder. They
>> can send the file without any problem. I can able to read and delete if I
>> login to windows server with test1 username.
>>
>> My problem is I can not open that files with another username. I have a
>> username call test2 and I need to login to windows server with this username
>> and run the script to import the files from test1 folder. I got access
>> denied message when I try to open it.
>>
>> file permission show ;
>>
>> -rwx------
>>
>> I changed the umask in profile to 002 , but did not fix the problem.
>>
>> Any idea?
>>
>> By the way I have a little knowledge of linux
>>
>> thank
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>>
>> --
>> Problem reports:       http://cygwin.com/problems.html
>> FAQ:                   http://cygwin.com/faq/
>> Documentation:         http://cygwin.com/docs.html
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>>
> 


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 14:59   ` Alex
@ 2017-05-16 15:22     ` cyg Simple
  2017-05-17 13:46       ` Alex
  2017-05-16 19:14     ` Dan Kegel
  1 sibling, 1 reply; 12+ messages in thread
From: cyg Simple @ 2017-05-16 15:22 UTC (permalink / raw)
  To: cygwin



On 5/16/2017 10:44 AM, Alex wrote:
> Yes I did , but I can access only the current files. If they send new
> file next time, it won't get this setup so not possible to open.
> 
> 
> I need something like folder permission and will apply to all files in
> it also must be apply to files   will be created latter
> 

Make sure that the directories are all created by Cygwin processes.
    From the top of the device.
Make sure that the directories can be read by group members.
Ensure that the test1 and test2 users are of the same group.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16  9:15 when I try to open file with another user on CYGWIN , I get access denied message Alex
  2017-05-16 11:31 ` Dan Kegel
@ 2017-05-16 17:12 ` Brian Inglis
  2017-05-17 14:02   ` Alex
  1 sibling, 1 reply; 12+ messages in thread
From: Brian Inglis @ 2017-05-16 17:12 UTC (permalink / raw)
  To: cygwin

On 2017-05-16 02:12, Alex wrote:
> I have windows 2008 server and external partner requested me to install
> CGYWIN on it so they can send a file to via SSH. I created a domain user
> called test1 and they sent me the public key and installed home folder.
> They can send the file without any problem. I can able to read and
> delete if I login to windows server with test1 username.
> My problem is I can not open that files with another username. I have a
> username call test2 and I need to login to windows server with this
> username and run the script to import the files from test1 folder. I got
> access denied message when I try to open it.
> file permission show ;
> -rwx------
> I changed the umask in profile to 002 , but did not fix the problem.
> Any idea?
> By the way I have a little knowledge of linux

You would have to change umask in sshd's user's profile to perhaps have
any effect.

You may want to check the receiving directory DACLs with getfacl .../
and if necessary change them with setfacl -m d:g::r--,d:o::r-- if only
data is being transferred to that directory.

Removing directory DACLs e.g. with setfacl -bk .../ can stop Windows
programs being able to read or write directories or contents.

Get them to set the permissions chmod +r on the source if possible,
and send with scp -p.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 14:59   ` Alex
  2017-05-16 15:22     ` cyg Simple
@ 2017-05-16 19:14     ` Dan Kegel
  2017-05-17 13:53       ` Alex
  1 sibling, 1 reply; 12+ messages in thread
From: Dan Kegel @ 2017-05-16 19:14 UTC (permalink / raw)
  To: cygwin

On Tue, May 16, 2017 at 7:44 AM, Alex <lombak@gmx.com> wrote:
>> Did you try
>>     chmod 755 foo.dat
>> on the file (assuming it's named foo.dat)?
>
> Yes I did , but I can access only the current files. If they send new file
> next time, it won't get this setup so not possible to open.

Just add the chmod in your script.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 15:22     ` cyg Simple
@ 2017-05-17 13:46       ` Alex
  0 siblings, 0 replies; 12+ messages in thread
From: Alex @ 2017-05-17 13:46 UTC (permalink / raw)
  To: cygwin

On 16/05/2017 17:59, cyg Simple wrote:
> 
> 
> On 5/16/2017 10:44 AM, Alex wrote:
>> Yes I did , but I can access only the current files. If they send new
>> file next time, it won't get this setup so not possible to open.
>>
>>
>> I need something like folder permission and will apply to all files in
>> it also must be apply to files   will be created latter
>>
> 
> Make sure that the directories are all created by Cygwin processes.

Only the folder mounted to home directory created on Windows
as I entered the below in fstab;
E:/SFTP/samplefolder   /home/gm-user1/samplefolder  ntfs 
override,binary,noacl 0 0

so other user try to access to E:/SFTP/samplefolder

>      From the top of the device.
> Make sure that the directories can be read by group members.
I created SFTP_User group in AD and both of them members
> Ensure that the test1 and test2 users are of the same group.
But when I run ls -la on inside the Samplefolder, owner says gm-user1 
groups says Domain Users ,  not sure why it shows Domain users

> 

thanks



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 19:14     ` Dan Kegel
@ 2017-05-17 13:53       ` Alex
  2017-05-17 14:35         ` Eliot Moss
  0 siblings, 1 reply; 12+ messages in thread
From: Alex @ 2017-05-17 13:53 UTC (permalink / raw)
  To: cygwin

On 16/05/2017 20:22, Dan Kegel wrote:
> On Tue, May 16, 2017 at 7:44 AM, Alex <lombak@gmx.com> wrote:
>>> Did you try
>>>      chmod 755 foo.dat
>>> on the file (assuming it's named foo.dat)?
>>
>> Yes I did , but I can access only the current files. If they send new file
>> next time, it won't get this setup so not possible to open.
> 
> Just add the chmod in your script.
> 
Hi Dan
Could you please tell me how can I chmod to script , I don't know how to 
do it
Thanks

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-16 17:12 ` Brian Inglis
@ 2017-05-17 14:02   ` Alex
  2017-05-17 17:08     ` Brian Inglis
  2017-05-18 12:23     ` Andrey Repin
  0 siblings, 2 replies; 12+ messages in thread
From: Alex @ 2017-05-17 14:02 UTC (permalink / raw)
  To: cygwin

On 16/05/2017 20:08, Brian Inglis wrote:
> On 2017-05-16 02:12, Alex wrote:
>> I have windows 2008 server and external partner requested me to install
>> CGYWIN on it so they can send a file to via SSH. I created a domain user
>> called test1 and they sent me the public key and installed home folder.
>> They can send the file without any problem. I can able to read and
>> delete if I login to windows server with test1 username.
>> My problem is I can not open that files with another username. I have a
>> username call test2 and I need to login to windows server with this
>> username and run the script to import the files from test1 folder. I got
>> access denied message when I try to open it.
>> file permission show ;
>> -rwx------
>> I changed the umask in profile to 002 , but did not fix the problem.
>> Any idea?
>> By the way I have a little knowledge of linux
> 
> You would have to change umask in sshd's user's profile to perhaps have
> any effect.

I did in the /etc/profile but not sure what you mean in sshd's user's 
profile !
> 
> You may want to check the receiving directory DACLs with getfacl .../
> and if necessary change them with setfacl -m d:g::r--,d:o::r-- if only
> data is being transferred to that directory.

#getfacl samplefolder
#owner :gm-user1
#group :Domain User
user ::rwx
group :: r-x
other:r-x


Yes they only transfer to file in this folder,  if I run setfacl for 
this directory, will it apply to files inside and the file will be added 
later ?
> 
> Removing directory DACLs e.g. with setfacl -bk .../ can stop Windows
> programs being able to read or write directories or contents.
> 
> Get them to set the permissions chmod +r on the source if possible,
they said already give the file with full permission for everyone

> and send with scp -p.
> 

?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-17 13:53       ` Alex
@ 2017-05-17 14:35         ` Eliot Moss
  0 siblings, 0 replies; 12+ messages in thread
From: Eliot Moss @ 2017-05-17 14:35 UTC (permalink / raw)
  To: cygwin

On 5/17/2017 9:45 AM, Alex wrote:
 > On 16/05/2017 20:22, Dan Kegel wrote:
 >> On Tue, May 16, 2017 at 7:44 AM, Alex <lombak@gmx.com> wrote:
 >>>> Did you try
 >>>>      chmod 755 foo.dat
 >>>> on the file (assuming it's named foo.dat)?
 >>>
 >>> Yes I did , but I can access only the current files. If they send new file
 >>> next time, it won't get this setup so not possible to open.
 >>
 >> Just add the chmod in your script.
 >>
 > Hi Dan
 > Could you please tell me how can I chmod to script , I don't know how to do it
 > Thanks

sftp has a chmod command that change the access modes of the remote file.
Add a chmod after the command that copies the file over.  chmod and the
meaning of the modes are standard Unix things, and "man chmod" for the
command line chmod (not the OS call) will explain it somewhat (the
syntax in sftp is probably more limited).

HTH -- Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-17 14:02   ` Alex
@ 2017-05-17 17:08     ` Brian Inglis
  2017-05-18 12:23     ` Andrey Repin
  1 sibling, 0 replies; 12+ messages in thread
From: Brian Inglis @ 2017-05-17 17:08 UTC (permalink / raw)
  To: cygwin

On 2017-05-17 07:53, Alex wrote:
> On 16/05/2017 20:08, Brian Inglis wrote:
>> On 2017-05-16 02:12, Alex wrote:
>>> I have windows 2008 server and external partner requested me to install
>>> CGYWIN on it so they can send a file to via SSH. I created a domain user
>>> called test1 and they sent me the public key and installed home folder.
>>> They can send the file without any problem. I can able to read and
>>> delete if I login to windows server with test1 username.
>>> My problem is I can not open that files with another username. I have a
>>> username call test2 and I need to login to windows server with this
>>> username and run the script to import the files from test1 folder. I got
>>> access denied message when I try to open it.
>>> file permission show ;
>>> -rwx------
>>> I changed the umask in profile to 002 , but did not fix the problem.
>>> Any idea?
>>> By the way I have a little knowledge of linux
>>
>> You would have to change umask in sshd's user's profile to perhaps have
>> any effect.
> 
> I did in the /etc/profile but not sure what you mean in sshd's user's
> profile!

Anything in sshd's startup that could change umask e.g. /etc/sshd.conf.
None of init, systemd, nor cygrunsrv require shells, so /etc/profile is
out.

>> You may want to check the receiving directory DACLs with getfacl .../
>> and if necessary change them with setfacl -m d:g::r--,d:o::r-- if only
>> data is being transferred to that directory.
> 
> #getfacl samplefolder
> #owner :gm-user1
> #group :Domain User
> user ::rwx
> group :: r-x
> other:r-x
> 
> Yes they only transfer to file in this folder,  if I run setfacl for
> this directory, will it apply to files inside and the file will be added
> later ?

Default ACLs are applied to directories or files created in that directory,
modified by creation options, or later commands.

>> Removing directory DACLs e.g. with setfacl -bk .../ can stop Windows
>> programs being able to read or write directories or contents.
>>
>> Get them to set the permissions chmod +r on the source if possible,
> they said already give the file with full permission for everyone
> 
>> and send with scp -p.
> ?

What file transfer client are they using?
You said ssh, so I assumed scp, -p retains permissions and timestamps.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: when I try to open file with another user on CYGWIN , I get access denied message
  2017-05-17 14:02   ` Alex
  2017-05-17 17:08     ` Brian Inglis
@ 2017-05-18 12:23     ` Andrey Repin
  1 sibling, 0 replies; 12+ messages in thread
From: Andrey Repin @ 2017-05-18 12:23 UTC (permalink / raw)
  To: Alex, cygwin

Greetings, Alex!

>> You may want to check the receiving directory DACLs with getfacl .../
>> and if necessary change them with setfacl -m d:g::r--,d:o::r-- if only
>> data is being transferred to that directory.

> #getfacl samplefolder
> #owner :gm-user1
> #group :Domain User
> user ::rwx
> group :: r-x
> other:r-x

Seems sane, though least desirable.

> Yes they only transfer to file in this folder,  if I run setfacl for 
> this directory, will it apply to files inside and the file will be added 
> later ?
>> 
>> Removing directory DACLs e.g. with setfacl -bk .../ can stop Windows
>> programs being able to read or write directories or contents.
>> 
>> Get them to set the permissions chmod +r on the source if possible,
> they said already give the file with full permission for everyone

At this point, I have a feeling that their software force 0700 on an unloaded
file.

But you may try to

setfacl -m d:u::rwx,g::rwx,d:m::rwx

on your directory and try to upload a new file.


-- 
With best regards,
Andrey Repin
Thursday, May 18, 2017 15:14:23

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-05-18 12:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16  9:15 when I try to open file with another user on CYGWIN , I get access denied message Alex
2017-05-16 11:31 ` Dan Kegel
2017-05-16 14:59   ` Alex
2017-05-16 15:22     ` cyg Simple
2017-05-17 13:46       ` Alex
2017-05-16 19:14     ` Dan Kegel
2017-05-17 13:53       ` Alex
2017-05-17 14:35         ` Eliot Moss
2017-05-16 17:12 ` Brian Inglis
2017-05-17 14:02   ` Alex
2017-05-17 17:08     ` Brian Inglis
2017-05-18 12:23     ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).