CVS thinks I'm Administrator, not myself

Cygwin中设置/etc/passwd教程
本文介绍如何在Cygwin环境下正确配置/etc/passwd文件,解决使用CVS时遇到的管理员权限及文件写入权限问题。包括通过mkpasswd命令自动创建或更新该文件的方法,针对不同Windows域环境的具体操作步骤,以及手动编辑该文件来设定用户信息和自定义家目录位置等。

(原文)http://www.gigascale.org/softdevel/faq/19.html

Christopher Brooks , 29 Oct 2001
Last updated: 14 Nov 2004

If, under Windows, when you run cvs update you are prompted for the Administrator password on the CVS repository, or you have permission problems writing to files, then you may need to set up /etc/passwd on machine to include your name and UID.

Location of /etc/passwd

Note that the actual location of /etc/passwd varies depending on where you installed Cygwin. If Cygwin is installed in c:/cygwin , then /etc/passwd will actually end up in c:/cygwin/etc/passwd

.

mkpasswd

The easiest way to update /etc/passwd is to run the mkpasswd command that is included with the Cygwin toolkit. Usually, when Cygwin is installed, mkpasswd is run and /etc/passwd is automatically created. If your account was added after Cygwin was installed, then you may need to run mkpasswd by hand.

mkpasswd -help will print out the help for mkpasswd.

Below are a few scenarios for updating /etc/passwd :

Your machine is in a windows domain

If your Windows machine is a member of a Windows domain, use this command to add yourself to /etc/passwd:

mkpasswd -d | grep yourlogin


 > /etc/passwd

Note that if your domain is rather large, then mkpasswd -d could take a minute to complete.

Your machine is not in a Windows domain

To generate /etc/passwd for all the local Windows accounts, try:

mkpasswd -l > /etc/passwd

Your home directory

/etc/passwd also defines where your home directory is. Usually, Cygwin will set your initial default home directory to /home/yourname , which maps to c:/cygwin/home/yourname .
Unfortunately, tools like Java do not know about the Cygwin directory mapping, so you may want to reset your home directory to a location outside of the Cygwin tree.
For example, if your home directory was at c:/users/yourname , then Cygwin would find this as /cygdrive/c/users/yourname because Cygwin mounts the c: drive as /cygdrive/c To set up Cygwin so that it finds your home directory, edit c:/cygwin/etc/passwd and change your home directory from /home/yourname to /cygdrive/c/users/yourname

Set up /etc/passwd by hand

Stephen Neuendorffer suggests

Edit /etc/passwd and add a new line that contains your information.
username :: userid : groupid : fullName : home directory :/bin/sh
Your username and fullname should be obvious. If you forget these, then CVS probably won't be much use to you! Your home directory is probably /home/ username . Your groupid should probably be the same as the administrator and your userid should be some unique number that is not used elsewhere in the file and less than 65535. Adding one to the largest number in the file will probably work.

Another suggestion for obtaining a userid is to look at your entry in /etc/passwd on a Unix machine and use that number.

mkgroup

There is also a mkgroup command that is similar to mkpasswd . mkgroup can be used to create /etc/group :

mkgroup -l > /etc/group

Other resources

The CVS Account Name FAQ covers how to use a CVS repository with a login that is different than your current login. Note that even if you configure your system to properly use a different login on the cvs server, then you may still have permission problems if you do not have /etc/passwd set up properly.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值