Archive:Contribute/Get a SVN Account (zh CN): Difference between revisions

From KDE TechBase
m (Text replace - "<code bash>" to "<syntaxhighlight lang="bash">")
m (AnneW moved page Contribute/Get a SVN Account (zh CN) to Archive:Contribute/Get a SVN Account (zh CN) without leaving a redirect: Obsolete)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Contribute/Get a SVN Account}}
 
本教程是关于如何申请 KDE SVN 账号的。
本教程是关于如何申请 KDE SVN 账号的。


Line 76: Line 76:
现在你已经有了你的密码,你需要对它加密,而不是明文发送。(注意:这种加密与许多 Linux 发行版为其 {{path|/etc/shadow}} 文件所使用的加密方式是一样的。)
现在你已经有了你的密码,你需要对它加密,而不是明文发送。(注意:这种加密与许多 Linux 发行版为其 {{path|/etc/shadow}} 文件所使用的加密方式是一样的。)


如果你的密码是 8 位的,做到加密的一种办法是使用 Perl:<!-- <code>perl -e "print crypt('&lt;your password&gt;','xy'),\"\n\";"</code> -->
如果你的密码是 8 位的,做到加密的一种办法是使用 Perl:<!-- <syntaxhighlight lang="text">perl -e "print crypt('&lt;your password&gt;','xy'),\"\n\";"</syntaxhighlight> -->
  <nowiki>perl -e 'print crypt("<your password>","\$1\$xyz\$")."\n";'</nowiki>
  <nowiki>perl -e 'print crypt("<your password>","\$1\$xyz\$")."\n";'</nowiki>
其中 &lt;your password&gt; 要换成你的密码,而 ''xyz'' 可以按你的选择是 3 到 8 个随机字符。在其前面保留 \$1\$,后面保留 \$。
其中 &lt;your password&gt; 要换成你的密码,而 ''xyz'' 可以按你的选择是 3 到 8 个随机字符。在其前面保留 \$1\$,后面保留 \$。


(提示:$ must be "escaped" with a backslash. For instance: If your password is "abc$123" you have to replace &lt;your password&gt; with "abc\$123". )
(提示:“$”号必须被一个反斜杠转义。例如:如果你的密码是"abc$123",你需要把&lt;your password&gt;替换为"abc\$123". )


'''注意''':do not worry to find your choice of &lt;xyz&gt; at the start of the encoded password, it is meant to be so.
'''注意''':不要担心你在加密开始的时候对&lt;xyz&gt;的选择,这是必须的。


Another solution is to create a dummy account on a Unix system where you have administrator access. You can use the built-in user management programs of your distribution and search for the account in your file {{path|/etc/shadow}} or you can use the following code:
另一个解决方法是在一个你拥有管理权限的Unix系统上创建一个新的账户。你可以使用系统内置用户管理程序。然后你可以在文件{{path|/etc/shadow}}里查找这个账户,或者你也可以使用下面的代码:
  useradd dummy; passwd dummy; grep dummy /etc/passwd /etc/shadow; userdel dummy
  useradd dummy; passwd dummy; grep dummy /etc/passwd /etc/shadow; userdel dummy


In any case, the password is then the part between the first ':' and the second ':'. (Note: not a star! (*) That means that it is not the password!)
无论使用何种方式何,密码总是在第一个':'和第二个':'之间。 (注意:不是星号!(*) 星号的意思是此处并非密码。)


Save the encoded password so that you can use it later in the application.
保存加密后的密码,它会在之后的应用程序中用到。


== 获得 SSH 密钥 ==
== 获得 SSH 密钥 ==
Line 95: Line 95:
本章节假定你想要通过 SSH 访问(而不是 HTTPS)。否则跳过本章节。
本章节假定你想要通过 SSH 访问(而不是 HTTPS)。否则跳过本章节。


Please refer to a SSH documentation or book to see how to create a pair of SSH keys, the short version is <syntaxhighlight lang="bash">ssh-keygen -t dsa</code>
Please refer to a SSH documentation or book to see how to create a pair of SSH keys, the short version is <syntaxhighlight lang="bash">ssh-keygen -t dsa</syntaxhighlight>
The '-t dsa' indicates that 'dsa' type keys should be created. Dsa keys are used in the version 2 of the SSH protocol, whereas rsa keys are used in version 1. See the  [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen ssh documentation] for more. Accept the default filename and the default of no passphrase.
The '-t dsa' indicates that 'dsa' type keys should be created. Dsa keys are used in the version 2 of the SSH protocol, whereas rsa keys are used in version 1. See the  [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen ssh documentation] for more. Accept the default filename and the default of no passphrase.



Latest revision as of 12:47, 23 June 2013

本教程是关于如何申请 KDE SVN 账号的。

注释

  • 单词 SVN 应用于所有 SVN 服务器。
  • 词组 KDE SVN 仅仅指 KDE 的 SVN 服务器。
  • 词组 匿名 SVN 指的是 KDE 的匿名 SVN 镜像。

KDE SVN 是什么?

为了能对 KDE SVN 进行写入访问,你需要使用 KDE 主 SVN 服务器。(匿名 SVN 用户使用此服务器哦的镜像。SVN 不允许你从一台服务器中读取数据并写入另一台服务器。)

为了能使用主 KDE SVN 服务器,你需要一个账号。一个账号由 用户名 (通常是你的姓),一个密码和一个电子邮件地址所组成。用户名用于登录,密码用于验证,而电子邮件地址用于在其它开发者想要联系账号持有者的时候能够联系到此人。(用户名有时候也可认为是 登录名。)

注意:你可以在 kde-common/accounts 中查看账号。那是一份所有账号的清单。对,账号清单是公开的,比如在 WebSVN 上。

访问主 KDE SVN,你有两种途径,它们有着不同的传输数据加密方法:

  • 使用 HTTPS
  • 使用 SSH

如果你从未使用过 ssh ,你可能更喜欢 HTTPS,它建立起来稍微简单一点。

然而,目前的 svn-over-ssh 似乎比 svn-over-https 快很多,所以这是个使用 ssh 的好理由。

你需要创建的密码取决于上述的选择:

  • 通过 HTTPS 访问所需的普通密码,或
  • 通过 SSH 访问所需的 SSH 公共密钥

KDE SVN 账号允许你在 KDE SVN 中的几乎任何地方写入数据。然而,也有例外:

  • KDE SVN 内部
  • admin 目录
  • www 模块(这个可以有例外。)

谁可以申请 KDE SVN 账号呢?

通常而言,任何对 KDE 作出贡献的开发者都可以申请一个 KDE SVN 账号。

翻译人员应该从其团队领队那边获得许可,这样他们便可组织在他/她的团队中如何开展工作了。请在请求账号的时候提及团队领队的许可。

顺便请 阅读 KDE SVN 提交策略。在使用你将来的 KDE SVN 账号的时候,你必须接受这些条款。

再者,请只有当你认为你会为 KDE 工作一段时间或更长时间的时候,再去申请一个账号。如果你知道你仅会工作几个星期,然后再也不工作的话,请考虑不去申请 KDE SVN 账号,但是仍然请你继续发送补丁。

The limitations are not there to exclude anyone - they are there to ensure that the maintenance of accounts remains reasonable.

当然,要澄清的是:KDE's sysadmins 拥有是否为某人创建 KDE SVN 账号的最终解释权。

选择密码

本章节假定你想要通过 HTTPS 访问(而不是 SSH)。否则跳过本章节。

首先你得选择一个密码。如果可能的话,请选择一个不用于你计算机上任何东西的密码(因为 SVN 账号对你计算机上的任何其它账号都没有用处。)

无论如何,请使用有关密码的 常识性的预防措施

强密码:

  • 同时拥有大写和小写的字母。
  • 既有字母又有数字和/或标点符号。
  • 容易记忆,所以它们用不着写下来。
  • 至少 8 位。

强密码 是:

  • 个人信息,比如你的名字、电话号码、社保卡密码、生日或地址。甚至相识人的名字和诸如此类的密码都不应该使用。
  • 任何词典中的单词,或者与某个词相近(比如拼为 backwards 的单词)。
  • 一个仅仅将字母简单换成数字的单词。例如,bl0wf1sh 不是一个强密码。
  • 当你输入时易于认出的密码。诸如 12345,qwerty (i.e., 所有的键都紧挨着),或是 nnnnnn,都该避免。

这里所有的规定都不为了是你烦恼,而是为了保证 KDE SVN 服务器有某个安全级别。

获得加密后的密码

本章节假定你想要通过 HTTPS 访问(而不是 SSH)。否则跳过本章节。

现在你已经有了你的密码,你需要对它加密,而不是明文发送。(注意:这种加密与许多 Linux 发行版为其 /etc/shadow 文件所使用的加密方式是一样的。)

如果你的密码是 8 位的,做到加密的一种办法是使用 Perl:

perl -e 'print crypt("<your password>","\$1\$xyz\$")."\n";'

其中 <your password> 要换成你的密码,而 xyz 可以按你的选择是 3 到 8 个随机字符。在其前面保留 \$1\$,后面保留 \$。

(提示:“$”号必须被一个反斜杠转义。例如:如果你的密码是"abc$123",你需要把<your password>替换为"abc\$123". )

注意:不要担心你在加密开始的时候对<xyz>的选择,这是必须的。

另一个解决方法是在一个你拥有管理权限的Unix系统上创建一个新的账户。你可以使用系统内置用户管理程序。然后你可以在文件/etc/shadow里查找这个账户,或者你也可以使用下面的代码:

useradd dummy; passwd dummy; grep dummy /etc/passwd /etc/shadow; userdel dummy

无论使用何种方式何,密码总是在第一个':'和第二个':'之间。 (注意:不是星号!(*) 星号的意思是此处并非密码。)

保存加密后的密码,它会在之后的应用程序中用到。

获得 SSH 密钥

本章节假定你想要通过 SSH 访问(而不是 HTTPS)。否则跳过本章节。

Please refer to a SSH documentation or book to see how to create a pair of SSH keys, the short version is

ssh-keygen -t dsa

The '-t dsa' indicates that 'dsa' type keys should be created. Dsa keys are used in the version 2 of the SSH protocol, whereas rsa keys are used in version 1. See the ssh documentation for more. Accept the default filename and the default of no passphrase.

需要的是 一个 SSH 公共密钥。不要向我们发送一个 GPG (OpenPGP) 密钥,那个毫无关系!

The password in the sense of this documentation is the public key that you are creating. The public key can usually be found at $HOME/.ssh/id_dsa.pub.

不要 发送 $HOME/.ssh/id_dsa 中的私钥,那个应当留作一个秘密。

You should also set up ssh-agent so you do not have to type the password every time. There are several tutorials available explaining how to do this, for example this one.

Tip
If you want to use SVN with SSH with another user than the one who created the keys, you need to copy $HOME/.ssh/id_dsa.pub and $HOME/.ssh/id_dsa to the other user's $HOME/.ssh directory. You should probably also backup those files.


申请账号

Now that you have a password, you need a username for your KDE SVN account. Normally your family name is used. Let us call it username for this example.

You can propose something else if you want. But be careful that one day, you could ask for a KDE email address and this would be the base for your address. For example: [email protected]. (Note, however, that KDE email addresses are not granted so easily anymore, as too many people have ranted with a KDE address and other people thought that it was the official position of the KDE Team. In the meantime, KDE Mail was created for if you need a permanent address.)

So now you have a username and a password. Now the email address: you have to use your own (be it a normal address or a KDE Mail address). Of course, do not forget that this email address becomes public (at least by WebSVN) so you will unfortunately get spam.

Also note that this email address should be the same one that you use on bugs.kde.org. If you don't have one, please create it so that it can be given usual developer rights. Closing bug reports with keywords in commit comments only works if the email address of your Subversion and bugs.kde.org accounts match.

Now you are ready to apply for for a KDE SVN account. Go to https://sysadmin.kde.org/svnaccount/ and fill out the form. It should be easy to do now.

After filling out the form, you will receive an email with a link to click on. This is done to verify your email address. The application is not complete before you click on it.

Also note that the form will ask you who has encouraged you to apply. He or she will also get an email to verify your request.

The form also holds a field justification, here you can explain what you want to do with your future KDE SVN account, like for examples developing a certain application, making documentations, being team leader of a translation...

然后呢?

After having sent the form and clicking the link in the email, you have to wait for the answer (typically within two or three days).

Once you have confirmation that your account has been created, you need to adapt your local copy to the new server. See the next tutorial for your first steps with your new account.

Please add your geographical location (what country are you in?) and other details at the Commit Digest data page so that the Commit Digest can accurately reflect who is working where.