MKPASSWD(1) CYGWIN MKPASSWD(1)NAME
- Print /etc/passwd file to stdout
SYNOPSISmkpasswd [OPTIONS]...
OPTIONS-l,--local [machine[,offset]]
print local user accounts with uid offset offset (from local
machine if no machine specified)
-L,--Local [machine[,offset]]
ditto, but generate username with machine prefix
-d,--domain [domain[,offset]]
print domain accounts with uid offset offset (from current
domain if no domain specified)
-D,--Domain [domain[,offset]]
ditto, but generate username with domain prefix
-c,--current
print current user
-C,--Current
ditto, but generate username with machine or domain prefix
-S,--separator char
for -L, -D, -C use character char as domain\user separator in
username instead of the default '\'
-o,--id-offset offset
change the default offset (10000) added to uids in domain or
foreign server accounts.
-u,--username username
only return information for the specified user one of -l, -L,
-d, -D must be specified, too
-p,--path-to-home path
use specified path instead of user account home dir or /home
prefix
-m,--no-mount
don't use mount points for home dir
-U,--unix userlist
additionally print UNIX users when using -l or -L\ on a UNIX
Samba server userlist is a comma-separated list of usernames or
uid ranges (root,-25,50-100). (enumerating large ranges can
take a long time!)
-s,--no-sids
(ignored)
-g,--local-groups
(ignored)
-h,--help
displays this message
-v,--version
version information and exit
Default is to print local accounts on stand-alone machines, domain
accounts on domain controllers and domain member machines.
DESCRIPTION
The mkpasswd program can be used to help configure Cygwin by creating
a /etc/passwd from your system information. Its use is essential to
include Windows security information. However, the actual passwords
are determined by Windows, not by the content of /etc/passwd.
The command is initially called by setup.exe to create a default
/etc/passwd. This should be sufficient in most circumstances. How‐
ever, especially when working in a multi-domain environment, you can
use mkpasswd manually to create a more complete /etc/passwd file for
all domains. Especially when you have the same user name used on mul‐
tiple machines or in multiple domains, you can use the -D, -L and -C
options to create unique domain\user style usernames.
Note that this information is static. If you change the user infor‐
mation in your system, you'll need to regenerate the passwd file for it
to have the new information.
The -d/-D and -l/-L options allow you to specify where the informa‐
tion comes from, the local machine or the domain (default or given), or
both. With the -d/-D options the program contacts the Domain Con‐
troller, which may be unreachable or have restricted access. Comma-sep‐
arated from the machine or domain, you can specify an offset which is
used as base added to the user's RID to compute the uid (offset + RID =
uid). This allows to create the same uids every time you re-run
mkpasswd. An entry for the current user can be created by using the
option -c or -C. If you want to use one of the -D, -L or -C
options, but you don't like the backslash as domain/group separator,
you can specify another separator using the -S option, similar to the
mkgroup. The -o option allows for special cases (such as multiple
domains) where the UIDs might match otherwise. The -m option bypasses
the current mount table so that, for example, two users who have a Win‐
dows home directory of H: could mount them differently. For more
information on SIDs, see ntsec /xref in the Cygwin User's Guide. The
-p option causes mkpasswd to use the specified prefix instead of the
account home dir or /home/. For example, this command:
$ mkpasswd-l -p "$(cygpath -H)" > /etc/passwd
would put local users' home directories in the Windows 'Profiles'
directory. The -u option creates just an entry for the specified
user. The -U option allows you to enumerate the standard UNIX users on
a Samba machine. It's used together with -l samba-server or -L samba-
server. The normal UNIX users are usually not enumerated, but they can
show up as file owners in ls -l output.
COPYRIGHT
Cygwin is Copyright (C) 1995-2010 Red Hat, Inc.
Cygwin is Free software; for complete licensing information, refer to:
http://cygwin.com/licensing.html
SEE ALSO
The full documentation to the Cygwin API is maintained on the web at:
http://cygwin.com/cygwin-api/cygwin-api.html
The website is updated more frequently than the man pages and should be
considered the authoritative source of information.
April 2010 MKPASSWD(1)