groupadd command not found in Cygwin

1

I have Windows 7 64-bit PC. I have installed Cygwin version 2.6.0 on it in c:\cygwin64 directory.

There was no /etc/passwd file. So I create that file by using mkpasswd -l > /etc/passwd command.

There was no /etc/group file. So I created that file by using mkgroup -l > /etc/group command.

Now I want to add a group using groupadd command. So I type in groupadd -g 535 finance_2 command. But I get this error message:

-bash: groupadd: command not found

Is this command part of any package of Cygwin which I dont have so have to download?

Or this command is totally missing from Cygwin? In that case how to add a group in Cygwin?

Thanks

ChumboChappati

Posted 2017-01-19T23:22:42.147

Reputation: 167

Answers

2

You need to create your users in Windows, then use them in cygwin :

The mkpasswd program can be used to create a /etc/passwd file. Cygwin doesn't need this file, because it reads user information from the Windows account databases

mkpassword on cygwin.com

Taz8du29

Posted 2017-01-19T23:22:42.147

Reputation: 213

2

-bash: groupadd: command not found

Cygwin does not have a `groupadd`` command.

Workaround:

Hi:

Can anybody tell me which packages do I need to install in order to execute the following commands:

groupadd useradd

...

To do this on cygwin, you need to add the user accounts and groups in windows, then regenerate your passwd and group files using mkpasswd/mkgroup.

If you want to add windows user groups/accounts from the cygwin environment, you can invoke the 'doze commands "net user" and "net localgroup" from a shell/script/whatever. Run "net user /?" and "net localgroup /?" for syntax details.

Source packages for groupadd and useradd commands

DavidPostill

Posted 2017-01-19T23:22:42.147

Reputation: 118 938