Hey Roland, thanks for your reply, I appreciate your perspective on this. After 
seeing Brian's message, that prompted me to check the M$ rules. Also thanks to 
Eliot for trying.

I noticed yesterday I was getting entries in Windows Security > Protection 
History. I managed to disable the rule: Attack surface reduction: Block use of 
copied or impersonated system tools. Both with a IT admin over Company Portal, 
and by running Set-MpPreference provided (thanks)

I then deleted C:/cygwin64, the downloads folder and the setup installer, and 
redownloaded it. Waited a day and retried. Now I don't see get any new entries 
in Protection History - great. Now when installing Cygwin, I see: Postinstall 
script errors:

Package: _/ca-certificates
        ca-certificates.sh exit code 126

Launching Cygwin64 Terminal has these errors on first launch:
```
Copying skeleton files.
These files are for the users to personalise their cygwin experience.

They will never be overwritten nor automatically updated.

-bash: /usr/bin/find: Permission denied
-bash: /usr/bin/hostname: Permission denied
```
and subsequently:
```
-bash: /usr/bin/hostname: Permission denied
```

Therefore I think there is a different permissions error I am facing?

Thank you

On Tuesday, 12 August 2025 at 17:03, Roland Mainz via Cygwin 
<cygwin@cygwin.com> wrote:

> On Tue, Aug 5, 2025 at 3:27 PM ben-xD via via Cygwin cygwin@cygwin.com wrote:
> 
> > [sending on behalf of ben-xD , redirected from
> > https://github.com/mintty/mintty/issues/563#issuecomment-3155007226]
> > 
> > Dear Cygwin mailing list,
> > 
> > I'd previously been happily using Cygwin on a non Azure AD enrolled
> > machine, but am now setting up a machine that is enrolled.
> > 
> > The problem is some packages fail to install due to permissions
> > issues when I first launch the Cygwin |setup-x86_64.exe|. |126| is a
> > permissions error code:
> > 
> > Screenshot:
> > https://github.com/user-attachments/assets/bf156f43-69d9-4ef7-aa01-0f0c8a80c44a
> > 
> > As soon as I launch Cygwin, I see
> > 
> > -bash: /usr/bin/hostname: Permission denied
> > 
> > |bash -l| also fails:
> > 
> > $ bash -l
> > bash: /usr/bin/hostname: Permission denied
> > 
> > |find| fails:
> > 
> > $ /usr/bin/find
> > bash: /usr/bin/find: Permission denied
> 
> 
> That sounds like a Microsoft Defender problem, which - depending on
> settings - blocks *.exe which have system tools with the same name in
> $PATH.
> 
> Example:
> ---- snip ----
> $ which -a hostname
> /usr/bin/hostname
> /cygdrive/c/Windows/system32/hostname
> ---- snip ----
> Defender thinks that /usr/bin/hostname tries to impersonate
> /cygdrive/c/Windows/system32/hostname, and therefore blocks it's
> execution.
> 
> Could you please try whether this fixes the problem for you (see
> https://learn.microsoft.com/en-us/defender-endpoint/attack-surface-reduction-rules-reference
> section "Block use of copied or impersonated system tools"):
> $ powershell -Command 'Set-MpPreference
> -AttackSurfaceReductionRules_Ids C0033C00-D16D-4114-A5A0-DC9B3A7D2CEB
> -AttackSurfaceReductionRules_Actions Disabled #
> 
> ... and please respond back to the list whether it worked, because
> this more or less has become a candidate for the Cygwin FAQ... ;-(
> 
> ----
> 
> Bye,
> Roland
> --
> __ . . __
> (o.\ \/ /.o) roland.ma...@nrubsig.org
> \\/\// MPEG specialist, C&&JAVA&&Sun&&Unix programmer
> /O /==\ O\ TEL +49 641 3992797
> (;O/ \/ \O;)
> 
> --
> Problem reports: https://cygwin.com/problems.html
> FAQ: https://cygwin.com/faq/
> Documentation: https://cygwin.com/docs.html
> Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple

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

Reply via email to