I've installed Cygwin but have trouble operating it conveniently. I'd like the ability to, for example, 'su peter' where peter has his own preference for home directory, and shell. I don't care about security. I do not need these "user accounts" to be visible to Windows' mechanisms.
I've been stymied in my efforts. I don't know how to set "no password required" in /etc/passwd. 'su' gives command not found.
(BTW, I did install Cygwin on a different machine several years ago with no problem. Am I fighting with recent "improvements"?)
Let me clarify my question. The facilities from /etc/passwd are: * assign a home directory. I want george and peter to have different directories. I do not care whether george and peter can modify each others files or not * I want george to be able to use a different shell from peter. I don't want goerge to need to type ** tcsh ** cd /home/george ** source .cshrc for every single shell that gets spawned. Is there an easy way to achieve this? Does the Windows facility even have the concept of preferred Cygwin shell?
Best Answer
I don't care about security.
Every Cygwin user must have a corresponding Windows user.
How do I add a new user in Cygwin?
Run the following commands:
This will synchronise the Cygwin users and group with the Windows user account.
If you are in a Domain use
-d
instead of-l
Change the user's default shell as appropriate by modifying
/etc/passwd
(which is a plain text fileThe format of the file is as follows:
I don't know how to set "no password required"
If you really don't care about security and want no password use:
From the
passwd
documentation:Source passwd
Am I fighting with recent "improvements"?
From Cygwin version 1.7.34 onward
/etc/passwd
is no longer used by default to manage user accounts.If
/etc/passwd
exists it will be used, but only to cater to existing installs and special situations.If
/etc/passwd
doesn't exist you can still create it. See mkpasswd and mkgroup for more information.Since version 1.7.34 Cygwin uses uses native Windows user management.
You should use the new mechanism to manage user accounts instead of
/etc/passwd
:Source POSIX accounts, permission, and security:
su
gives command not found.Install
sshd
and usessh username@localhost
as asu
replacement.You can define a
su
alias to make this easier.Source Why doesn't su work?