How can I change permissions of the Cygwin folder in Windows 7?

2

Every time I want to change permissions through explorer I get an access denied error, and I'm using an administrator account.

What I need is to add an script to the /bin directory, but I'm not allowed to write there...

Zequez

Posted 2011-08-19T22:34:21.983

Reputation: 1 564

If you are really a member of group Administrators, then Explorer should offer to elevate when you try to change the permissions (i.e., you should see UAC shield icons on the buttons you have to click in the properties dialog). Are you sure you're a member of group Administrators? – Fran – 2012-05-28T21:06:01.730

@Fran: only if the owner of the file allows it, as I discovered (see my answer below). The OP may need to adjust the owner of the c:\cygwin tree in order to change /etc/passwd. – Bogatyr – 2012-08-29T16:18:37.450

Answers

2

You should not be adding personal scripts to /bin or /usr/bin

Those should go in ~/bin

$ touch blah.sh

$ mkdir ~/bin

$ mv blah.sh ~/bin

$ echo 'PATH+=:~/bin' >> ~/.bash_profile

Steven Penny

Posted 2011-08-19T22:34:21.983

Reputation: 7 294

1

I had a similar issue, my system had gone through a lot of changes: switching domains, different user accounts, etc. I needed to replace /etc/passwd with the current output from mkpasswd but couldn't find any way to adjust the permissions on that folder/file even with my current user who was an administrator.

The problem turned out to be that the windows owner of the c:\cygwin folder was some "unknown user" (probably from the old domain). So using my current account with admin privileges I changed the owner of the c:\cygwin hierarchy to my current account, then I could adjust the permissions on /etc/passwd to allow me to change it.

Bogatyr

Posted 2011-08-19T22:34:21.983

Reputation: 159