Safely change home directory

前端 未结 12 2345
南旧
南旧 2020-12-12 10:22

I\'m trying to safely update the home directory as specified in /etc/passwd, but the standard Linux utils - usermod and vipw - for doing so aren\'t provided by

12条回答
  •  不知归路
    2020-12-12 11:01

    EDIT: For recent versions of Cygwin (1.7.34 and beyond), see this newer question.

    Like sblundy's answer, you can always edit by-hand.

    But if you want to do it the "official" way, use the cygwin-specific mkpasswd command. Below is a snippet from the official docs on mkpasswd :

    For example, this command:

    Example 3.11. Using an alternate home root

    $ mkpasswd -l -p "$(cygpath -H)" > /etc/passwd
    

    would put local users' home directories in the Windows 'Profiles' directory.

    There's a bunch of other really useful commands described on the Cygwin Utilities documentation page (which includes mkpasswd). The use of cygpath in the example above is another of these cygwin-specific tools.

    While you're at it, you probably also want to read the Using Cygwin Effectively with Windows documentation. There's a bunch of really good advice.

提交回复
热议问题