https://wiki.ubuntu.org.cn/api.php?action=feedcontributions&user=Nakedpig&feedformat=atomUbuntu中文 - 用户贡献 [zh-hans]2024-03-29T07:25:45Z用户贡献MediaWiki 1.26.3https://wiki.ubuntu.org.cn/index.php?title=OpenSSH%E9%AB%98%E7%BA%A7%E6%95%99%E7%A8%8B&diff=22806OpenSSH高级教程2007-06-07T11:56:45Z<p>Nakedpig:/* 在远程电脑寄存密匙 */</p>
<hr />
<div>== OpenSSH 高级教程 ==<br />
<br />
原文出处:官方Wiki<br />
<br />
原文作者:<br />
<br />
授权许可:<br />
* [http://creativecommons.org/licenses/by-sa/2.0/ 创作共用协议Attribution-ShareAlike 2.0]<br />
* [http://www.gnu.org/copyleft/fdl.html GNU自由文档许可证]<br />
<br />
翻译人员:fiftymetre<br />
<br />
校正人员:<br />
<br />
贡献人员:<br />
<br />
适用版本:<br />
<br />
文章状态:等待校正<br />
----<br />
<br />
译者的话:第一次翻译这英文文章,译的不好的地方也许大家包含,我会努力在下一章中尽我所能的提高翻译质量。翻译这篇文章时,还特意找一了本“SSH权威指南”研究了一下,以前在win下都是用SSH Secure Shell来跟ubuntn来传文件的呵呵。但ubuntu6.06桌面版本默认安装却没有安装SSH。<br />
----<br />
<br />
<br />
=== 介绍 ===<br />
介绍 这篇指南由浅入深的介绍属于标准Ubuntu OpenSSH服务的默认配置和高级设置。这篇文章将详细论述server-side(服务器端)配置指导,并解释了利用Rivest Shamir Adleman (RSA) 算法(注1)生成密钥登陆 OpenSSH 服务器与明文密码的区别.附加的资源为OpenSSH 索引在指南部分。<br />
<br />
<br />
<br />
=== 面向读者 ===<br />
适当的设定这篇文章里的参数 ,读者应该是一个善于使用命令行程序的Ubuntu用户,使用bash环境,并在基于控制台的文本编辑器程序里把系统配置文件编辑成他们的首选设置,另 外,读者应该知道如何启动和关闭系统,并且基本的了解OpenSSH 程序包的安装,及其目的。<br />
<br />
<br />
<br />
=== 关于 OpenSSH ===<br />
OpenSSH OpenSSH是一种可以自由获得的安全Shell (SSH)协议族工具用来操作控制电脑,或在电脑之间传送文件。传统的工具要完成这样的功能得使用telnet(终端仿真协议),或极不安全的rcp(注 2),并由此来传送用户的密码口令。OpenSSH 提供一种无交互后台程序服务,和可以容易使用的用户工具,来加密远程控制装置,和传输文件操作,由此来代替原来的类似服务。<br />
<br />
<br />
<br />
=== OpenSSH 服务 (sshd) ===<br />
OpenSSH 服务,SSH,是作为代表性地独立守护程序,然而如果愿意的话也可以让该服务成为按需访问的策略(as- needed basis)的网络守护进程,来监视一些网络请求的守护进程(注3),或更进一步的扩展网络守护进程,或同等安全的, xinetd(注 4)。OpenSSH 服务配置经过 file /etc/ssh/sshd_config 目录创建。这部分内容将讨论默认安装配置文件,和告诉他们如 何做某些修改来得到更安全的 sshd。首先来看默认设置(in italics, such as Port 22)的简单说明,根据建议设置 (in bold, such as Protocol 2)介绍来增强安全防护。<br />
<br />
给你的OpenSSH 安装中改变 sshd的结构,首先制做备份你的原始 /etc/ssh/sshd_config 文件,在终端shell中输入下列命令:<br />
<br />
<code><nowiki>sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
你可以随意的选择保存原始文件的存取模式 使用下列命令:<br />
<br />
<code><nowiki>sudo chmod a-w /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
以这样备份配置文件的方式被认为是最好的练习管理你的Ubuntu GNU/Linux system的方法。如果因为一些原因你需要恢复到原始 的配置,你可以很方便的,并且无论何时你造成一个错误,或执行了无法返回的错配置应用程序,你将总是可以返回到你的原始文件,以提供你在返回它(原始配置 文件)之前已经向后支持它。<br />
<br />
现在你已经保存了原始的 /etc/ssh/sshd_config 文件,你可以修改或替换文件的默认值和设定,和建议设定。在你改变任何设定到产生任何结果,你必须保存 /etc/ssh/sshd_config 文件,和重新启动 sshd 使用下命令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 建议 OpenSSH 服务设定 ====<br />
Ubuntu的OpenSSH的实现使用的默认 /etc/ssh/sshd_config 配置文件比其他GNU linux发行版还要更安全。但是还可以进一步提高现有的安全程度,而且那些建议在这里实被提到。在特别情况下一些变化对你可能是不适当的。使用提供的设 置来做出最有利的安全性抉择,还有你环境的可用性。<br />
<br />
===== 登录 =====<br />
{|border="1" cellspacing="0"<br />
|登录级别''<code><nowiki> </nowiki></code>''信息 <br />
|}<br />
默认设定允许 sshd 记录 AUTH 设备的syslog(系统日志),在信息级别。如果使用默认设置的 ssh 远程访问你的Ubuntu电脑,你应该考虑直接抛出LogLevel的日志详细级别给VERBOSE,因为这样你可以获得详细的关于所有企图和成功ssh登记。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|详细登录级别 <br />
|}<br />
<br />
<br />
现在所有ssh 登记程序详情,和可能的登录程序将记录在你的AUTH上下文中/var/log/auth.log logfile 详细方式。<br />
<br />
===== 验证 =====<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>LoginGraceTime 120</nowiki></code>'' <br />
|}<br />
默认设定,Ubuntu's的OpenSSH 服务配置从登录提示被显示的时间起到120 秒 (二分钟),直到在连接被 sshd 结束之前,用户必须开始登录过程。这个行为受登录时间指令的约束。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>LoginGraceTime 20</nowiki></code>''' <br />
|}<br />
<br />
<br />
在断开远程访问实用程序这前sshd服务将只为用户提供20秒等待。这可以有助于自动化阻遏,或者暴力攻击ssh,和拒绝服务式攻击(Dos)。<br />
<br />
LoginGraceTime<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>X11Forwarding yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
如果计算机提供传统服务,(E-Mail服务或Web服务),而且没有在以任何的形式 (像是 LTSP) 提供 X11 服务,那时X11数据封装将失去修改X11Forwarding指令到去除潜在的攻击向量,特别是连接到 ssh 用户。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>X11Forwarding no</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在X11 forwarding将无法有效的来自你的 sshd。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png '''警告''': 如果服务是基于使用X11服务的,或来自LTSP,那时X11 Forwarding将关闭,或者你将失去对此能力的支持!<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#Banner /etc/issue.net</nowiki></code>'' <br />
|}<br />
<br />
<br />
显示一个不欢迎的警示条,或更好的方法对于安全是件好事。它告知好奇的人,或者故意的未经许可的访客到你的OpenSSH服务器,因为远程访问你的计算机是需要经过许可的,并且需要用户授权。<br />
<br />
<br />
<br />
有一个预登陆的条目可以对你成功防范一个攻击者有很大的帮助,或别的组织未经许可的尝试经由ssh访问你的服务器。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Banner /etc/issue.net</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在激活那个显示条目 /etc/ssh/sshd_config,使用下列的程序和例子内容来创建实际的条目文件:<br />
<br />
使用sudo,和你喜欢的编辑软件,创建文件 /etc/issue,并把下面的文字写在里面作为预登陆告警条的起点:<br />
<br />
<pre><nowiki><br />
***************************************************************************<br />
NOTICE TO USERS<br />
This computer system is the private property of its owner, whether<br />
individual, corporate or government. It is for authorized use only.<br />
Users (authorized or unauthorized) have no explicit or implicit<br />
expectation of privacy.<br />
Any or all uses of this system and all files on this system may be<br />
intercepted, monitored, recorded, copied, audited, inspected, and<br />
disclosed to your employer, to authorized site, government, and law<br />
enforcement personnel, as well as authorized officials of government<br />
agencies, both domestic and foreign.<br />
By using this system, the user consents to such interception, monitoring,<br />
recording, copying, auditing, inspection, and disclosure at the<br />
discretion of such personnel or officials. Unauthorized or improper use<br />
of this system may result in civil and criminal penalties and<br />
administrative or disciplinary action, as appropriate. By continuing to<br />
use this system you indicate your awareness of and consent to these terms<br />
and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the<br />
conditions stated in this warning.<br />
****************************************************************************<br />
</nowiki></pre><br />
<code><nowiki>保存文件,并且创建一个符号连结到 /etc/issue.net 文件使用下列命令:</nowiki></code><br />
<br />
<code><nowiki>sudo ln -s /etc/issue /etc/issue.net</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
一旦重新启动sshd,所有的登陆尝试都会遇到上面的警告,并且有登陆提示符在这后面,所有的非授权访问者将受到一个清晰的消息"你的电脑只能通过授权才 能使用,不欢迎非授权使用,上面的警告条是丛US DEPARTMENT OF DEFENCE 的警告条的修改版本生成的,对于专业使用是足够合适的,可能对于个人用户就更加合适了。<br />
<br />
做为旁边注解,所有本地控制台应用程序也同样显示来自 /etc/issue 文件的信息,甚至在物理层使用这台电脑的人也会收到这样的警告。如果这不是你想要的行为,然后把条目的内容放在 /etc/issue文件中,而不是做一个到/etc.issue的一个符号联接,/etc/issue中没有任何文本。由于没有文字在 /etc/issue,警告将只出现在那些尝试访问系统的人的面前。<br />
<br />
=== 额外配置技巧 ===<br />
下面的内容是一些额外的暗示和一些配置一个更加安全的openssh安装的技巧,这些技巧利用一些不包含在默认的ubuntussh配置文件中的指令,并且提出其他加强你的ssh安装安全的方法。<br />
<br />
==== 允许和拒绝用户和用户组 ====<br />
在配置文件中你可以使用一些指令来允许或者拒绝一些特定用户或者用户组用ssh登陆.这个方法更加细致的控制哪些人可以通过ssh来进入你的Ubuntu电脑。<br />
<br />
例如,如果你想只允许jhendrix和svaughan通过ssh登陆,你可以向这样在你的/etc/ssh中使用allowusers指令。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''允许 jhendrix svaughan''' <br />
|}<br />
<br />
<br />
如果你不想让所有用户能过 ssh 登陆,除了使用者 wgates,或sballmer然后你可以使用DenyUsers命令添加到/etc/ssh/sshd_config中,像这样:<br />
<br />
{|border="1" cellspacing="0"<br />
|'''拒绝用户 wgates sballmer''' <br />
|}<br />
<br />
<br />
最后,再看一个例子,你可以这样配置你的OpenSSH服务,只有用户属于系统组才允许通过ssh 登录。在这个例子中,我们将执行一些必要手段只允许SSH的用户都是小组成员sshlogin。 sudo addgroup --gid 450 sshlogin sudo adduser <username> sshlogin。<br />
<br />
<code><nowiki>sudo addgroup --gid 450 sshlogin</nowiki></code><br />
<br />
<code><nowiki>sudo adduser <username> sshlogin</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
在以上的例子中是用'<username>'代替你的用户名加入到sshlogin系统组。最后,编辑你的 /etc/ssh/sshd_config,并增添allowgroups指令:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>AllowGroups sshlogin</nowiki></code>''' <br />
|}<br />
<br />
<br />
重新启动 sshd,并且只有属于sshlogin组的用户才可以通过ssh 登录到你的Ubuntu计算机。<br />
<br />
==== 启动 sshd来监听不同的端口 ====<br />
由于近来自动扫描ssh和暴力攻击工具的大量增长,很多装有ssh的用户和管理员决定给ssh用一个非标准的tcp端口,标准的sshd侦听端口是 tcp/22,并且暴力扫描攻击工具都典型的被配置成侦听这个端口用来查找后门。<br />
<br />
尽管从使用简单密码的ssh登陆切换到使用基于键盘方式的登陆,就象在指南中下部分我们要讨论的显著减少了自动工具猜测出一个正确的在你的系统的登陆的机会,一些人觉得加入更多偏僻字的层数可能更会增强安全性。<br />
<br />
如果你曾考虑过在非标准端口上运行的你的sshd分支,例如一个常量需要使用-p或者-P来切换不同的ssh工具,或者通过修改配置文件这种更长久的方式来检验端口改变的正确,并且接受那些协议,然后改变侦听端口是十分琐碎的。<br />
<br />
仅仅增加一个或更多的端口在你的 /etc/ssh/sshd_config 文件中,因此:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
如果你希望侦听tcp/22,和tcp/2222端口,例如,局域网连接可以显示成传统方式,但可以响应外部联接tcp/2222端口而不在需要网络地址翻译规则,和连接你的路由器,随后双方只是增添指令到 /etc/ssh/sshd_config:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 22</nowiki></code>''' <br />
|-<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要忘记保存文件,和重新启动你的sshd指令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
为改变生效。<br />
<br />
=== 基于RSA key登陆 ===<br />
基于key的授权是可用的ssh授权方法中的一种,因此简单的密码(Ubuntu默认密码)和Kerberos标签。基于Key的验证的几个优点比密码验证更好,至于例子这个key的值就十分明显的很难被暴力破解,或以大量的关键字为条件来猜测弱密码。<br />
<br />
数字键也是如此,是对极其相似事物的一个比方,所以可以在可能出现弱密码的地方显示密码安全的程度。使用基于Key登录的ssh 是比使用弱密码的登录,普遍认为更安全的。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png ''注解''''':''' ''同时生成一套能够使用openssh的RSA key而不需要密码是可能的,简单讲,通过ssh登陆不要密码,这个指导书没有描述或者认定这种用法是很不安全的.如果这个缺少密码的key落入其他人手 中,就如你的授权一样,应此所有允许这些key的系统安全都很容易受到威胁,在一些情况下,例如不安全的群环境中,需要有完全没有密码的登陆,但是,这本 着到书没有解释制造这种key的过程。''<br />
<br />
'' ''<br />
<br />
这部分将说明启动基本Key登录的ssh ,生成一套公有/私有RSA密匙,并使用它们由OpenSSH登录你的Ubuntu计算机。<br />
<br />
==== 生成 RSA 密匙 ====<br />
第一步包括生成一组用于验证的RSA 密匙。代表性意思是,你将在想要通过某台电脑去远程登陆其他电脑的这台机器上做这些事情,但是这不是非常重要,因为你总是可以到处把你的密匙安装到需要的机器上。到生成一个RSA 公有/私有密匙,使用下列命令行:<br />
<br />
<code><nowiki>b@tsh:~ ssh-keygen -t rsa</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
你必须在一个位置保存你的密匙,和一串对应于你的密匙的passphrase(密码短语口令)注5。当选择passphrase对于密匙时,应选择非常坚 固的passphrase,和便宜于记忆的,和记录它的位置的安全。这passphrase必须使用钥匙,在每次你要登录到一个基于密匙的系统:<br />
<br />
<pre><nowiki><br />
生成公有/私有RSA密匙对。<br />
进入保证密匙的文件(/home/b/.ssh/id_rsa):<br />
进入passphrase(empty for no passphrase):<br />
再次进入同一passphrase:<br />
你的验证文件保存在/home/b/.ssh/id_rsa.<br />
你的公有密匙保存在 /home/b/.ssh/id_rsa.pub.<br />
</nowiki></pre><br />
祝贺你现在已经有了密匙组。现在布置你的系统已允许你的登录它们。<br />
<br />
==== 在远程电脑寄存密匙 ====<br />
假设你想使用key的远程ubuntu已经运行了ssh后台程序,接下来放置你自己key对的公共部分在那些电脑上是十分简单的,例如,如果你喜 欢开始用基于key的方式登陆一个叫madsion的远程电脑,并且madsion正在运行sshd,并且能够用名字通过网络来到达这台机器,就可以很简 单的用sshcopy这个命令来恰当的放置你的key:<br />
<code><nowiki>ssh-copy-id -i ~/.ssh/id_rsa.pub b@madison</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 登录测试 ====<br />
接下来, 你将要登录测试,配置连接到机器并使用你的passphrase来解开密匙:<br />
<br />
<code><nowiki>ssh madison</nowiki></code><br />
<br />
你会看到一个要你给出key的passphrase的命令提示符:<br />
{|border="1" cellspacing="0"<br />
|Enter passphrase for key '/home/b/.ssh/id_rsa': <br />
|}<br />
<br />
<br />
输入你的passphrase,并把madison设置为允许从基于密匙的登录,你将要使用它登录。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png '''''注解'':''' 上述的例子只是:一个例子!代替用户名,在这个例子中,机器名用你自己实际的名字是为了增加你成功的机会。 ;-)<br />
<br />
==== 行不通的事! ====<br />
如果你不是被提示要求passphrase,而是仅仅得到<br />
{|border="1" cellspacing="0"<br />
|b@madison's password: <br />
|}<br />
<br />
<br />
提示同样使用密码登录,然后读取。有一些情况可以预防向上面提到的这种情况。在默认的Ubuntu安装里,上面的例子能够运行。如果不,下列各项条件,例如这些时常发生的原因:<br />
<br />
在远程计算机上,确认 /etc/ssh/sshd_config包含下列各项,和没有它们的注解;<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>PubkeyAuthentication yes</nowiki></code> <br />
|}<br />
<br />
<br />
如果没有加它们,或没有注解,那么重要启动sshd,并重新再试一个登录。如果你现在得到了passphrase的提示,那要祝贺你可以用密匙登录了!<br />
<br />
==== 从这里到那里? ====<br />
如过你已经成功建立了一个基于RAS密匙的登陆,你可能希望这是你Ubuntu系统上唯一可接受的授权方式,完全放弃弱密码授权.按照这个路线,将能确保自动暴力扫描和攻击工具对你的公共系统攻击更加困难,提前提醒,你一旦丢失了密匙,你会发现你自己也被关在系统外面!<br />
<br />
从通知你的sshd不允许弱密码,到只是简单的使用sudo和你喜欢的编辑软件编辑 /etc/ssh/sshd_config,和下列各项指令改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#PasswordAuthentication yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
by uncommenting it, and changing ''yes'' to ''no'':<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PasswordAuthentication no</nowiki></code>''' <br />
|}<br />
<br />
<br />
保存文件,并重新启动sshd以使弱密码验证无效。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png '''警告''' : 做二次,使弱密码验证无效行为,和没有使用密匙登录,或丢失了你的密匙,你并被锁在你的机器外面了。当然,你仍然可以经过控制台登录机器上,但这可能不是那么容易,如果你的电脑是500哩远呢!你已被再次警告这样是不行的''!''<br />
<br />
此外,你可以改变允许使用基于密匙的登录的登录指令,到执行策略为以基于密码的登录。你可以做这个通过改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>PermitRootLogin yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
to<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PermitRootLogin without-password</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要由于没有密码而被警告.这并不意味着一个人用root登陆的时候不需要提供密码,仅仅相当,这意味着没有人可以用密码认证的方法使用root来登陆,意味着用root登陆的时候可能只能使用公共密匙方式登陆。<br />
<br />
=== 资源 ===<br />
更多资源与高级配置OpenSSH的安全性在以下表格中。<br />
<br />
==== 本地系统资源 ====<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>man sshd</nowiki></code> || System manual page for the <code><nowiki>sshd</nowiki></code> server daemon <br />
|-<br />
|<code><nowiki>man sshd_config</nowiki></code> || System manual page for the <code><nowiki>/etc/ssh/sshd_config</nowiki></code> configuration file <br />
|-<br />
|<code><nowiki>man ssh-copy-id</nowiki></code> || System manual page for the <code><nowiki>ssh-copy-id</nowiki></code> application <br />
|-<br />
|<code><nowiki>man ssh-keygen</nowiki></code> || System manual page for the <code><nowiki>ssh-keygen</nowiki></code> application <br />
|-<br />
|<code><nowiki>/etc/ssh/sshd_config</nowiki></code> || The OpenSSH Secure Shell Daemon (<code><nowiki>sshd</nowiki></code>) configuration file <br />
|}<br />
==== WWW Resources ====<br />
[http://www.debian-administration.org/articles/87 Keeping SSH access secure]<br />
<br />
[http://www.openssh.org/ OpenSSH Website]<br />
<br />
[http://www.debian-administration.org/articles/152 Password-less logins with OpenSSH]<br />
<br />
注1: 它是第一个既能用于数据加密也能用于数字签名的算法。它易于理解和操作,也很流行。算法的名字以发明者的名字命名:Ron Rivest, Adi Shamir 和Leonard Adleman。但RSA的安全性一直未能得到理论上的证明。它经历了各种攻击,至今未被完全攻破。<br />
<br />
注2: (rcp) 远端复制协议。该协议允许用户从网络的一个远端主机或者服务器上的文件系统中上载和下载文件。远端复制协议使用TCP协议来确保数据传输的可靠性。<br />
<br />
注3: 原处为"inetd" 意思就是监视一些网络请求的守护进程,其根据网络请求来调用相应的服务进程来处理连接请求。<br />
<br />
注4: xinetd(eXtended InterNET services daemon)提供类似于inetd+tcp_wrapper的功能,但是更加强大和安全。<br />
<br />
注5: 相对“密码”(password)而言,密码短语(passphrase)口令以其更为严密的安全性正受到IT界的广泛关注。在功能上,passphrase同密码一样,只是长度较密码长。通常passphrase使用4到5个单词取代原来数字、字母结合的方式。</div>Nakedpighttps://wiki.ubuntu.org.cn/index.php?title=OpenSSH%E9%AB%98%E7%BA%A7%E6%95%99%E7%A8%8B&diff=22805OpenSSH高级教程2007-06-07T11:56:16Z<p>Nakedpig:/* 生成 RSA 密匙 */</p>
<hr />
<div>== OpenSSH 高级教程 ==<br />
<br />
原文出处:官方Wiki<br />
<br />
原文作者:<br />
<br />
授权许可:<br />
* [http://creativecommons.org/licenses/by-sa/2.0/ 创作共用协议Attribution-ShareAlike 2.0]<br />
* [http://www.gnu.org/copyleft/fdl.html GNU自由文档许可证]<br />
<br />
翻译人员:fiftymetre<br />
<br />
校正人员:<br />
<br />
贡献人员:<br />
<br />
适用版本:<br />
<br />
文章状态:等待校正<br />
----<br />
<br />
译者的话:第一次翻译这英文文章,译的不好的地方也许大家包含,我会努力在下一章中尽我所能的提高翻译质量。翻译这篇文章时,还特意找一了本“SSH权威指南”研究了一下,以前在win下都是用SSH Secure Shell来跟ubuntn来传文件的呵呵。但ubuntu6.06桌面版本默认安装却没有安装SSH。<br />
----<br />
<br />
<br />
=== 介绍 ===<br />
介绍 这篇指南由浅入深的介绍属于标准Ubuntu OpenSSH服务的默认配置和高级设置。这篇文章将详细论述server-side(服务器端)配置指导,并解释了利用Rivest Shamir Adleman (RSA) 算法(注1)生成密钥登陆 OpenSSH 服务器与明文密码的区别.附加的资源为OpenSSH 索引在指南部分。<br />
<br />
<br />
<br />
=== 面向读者 ===<br />
适当的设定这篇文章里的参数 ,读者应该是一个善于使用命令行程序的Ubuntu用户,使用bash环境,并在基于控制台的文本编辑器程序里把系统配置文件编辑成他们的首选设置,另 外,读者应该知道如何启动和关闭系统,并且基本的了解OpenSSH 程序包的安装,及其目的。<br />
<br />
<br />
<br />
=== 关于 OpenSSH ===<br />
OpenSSH OpenSSH是一种可以自由获得的安全Shell (SSH)协议族工具用来操作控制电脑,或在电脑之间传送文件。传统的工具要完成这样的功能得使用telnet(终端仿真协议),或极不安全的rcp(注 2),并由此来传送用户的密码口令。OpenSSH 提供一种无交互后台程序服务,和可以容易使用的用户工具,来加密远程控制装置,和传输文件操作,由此来代替原来的类似服务。<br />
<br />
<br />
<br />
=== OpenSSH 服务 (sshd) ===<br />
OpenSSH 服务,SSH,是作为代表性地独立守护程序,然而如果愿意的话也可以让该服务成为按需访问的策略(as- needed basis)的网络守护进程,来监视一些网络请求的守护进程(注3),或更进一步的扩展网络守护进程,或同等安全的, xinetd(注 4)。OpenSSH 服务配置经过 file /etc/ssh/sshd_config 目录创建。这部分内容将讨论默认安装配置文件,和告诉他们如 何做某些修改来得到更安全的 sshd。首先来看默认设置(in italics, such as Port 22)的简单说明,根据建议设置 (in bold, such as Protocol 2)介绍来增强安全防护。<br />
<br />
给你的OpenSSH 安装中改变 sshd的结构,首先制做备份你的原始 /etc/ssh/sshd_config 文件,在终端shell中输入下列命令:<br />
<br />
<code><nowiki>sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
你可以随意的选择保存原始文件的存取模式 使用下列命令:<br />
<br />
<code><nowiki>sudo chmod a-w /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
以这样备份配置文件的方式被认为是最好的练习管理你的Ubuntu GNU/Linux system的方法。如果因为一些原因你需要恢复到原始 的配置,你可以很方便的,并且无论何时你造成一个错误,或执行了无法返回的错配置应用程序,你将总是可以返回到你的原始文件,以提供你在返回它(原始配置 文件)之前已经向后支持它。<br />
<br />
现在你已经保存了原始的 /etc/ssh/sshd_config 文件,你可以修改或替换文件的默认值和设定,和建议设定。在你改变任何设定到产生任何结果,你必须保存 /etc/ssh/sshd_config 文件,和重新启动 sshd 使用下命令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 建议 OpenSSH 服务设定 ====<br />
Ubuntu的OpenSSH的实现使用的默认 /etc/ssh/sshd_config 配置文件比其他GNU linux发行版还要更安全。但是还可以进一步提高现有的安全程度,而且那些建议在这里实被提到。在特别情况下一些变化对你可能是不适当的。使用提供的设 置来做出最有利的安全性抉择,还有你环境的可用性。<br />
<br />
===== 登录 =====<br />
{|border="1" cellspacing="0"<br />
|登录级别''<code><nowiki> </nowiki></code>''信息 <br />
|}<br />
默认设定允许 sshd 记录 AUTH 设备的syslog(系统日志),在信息级别。如果使用默认设置的 ssh 远程访问你的Ubuntu电脑,你应该考虑直接抛出LogLevel的日志详细级别给VERBOSE,因为这样你可以获得详细的关于所有企图和成功ssh登记。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|详细登录级别 <br />
|}<br />
<br />
<br />
现在所有ssh 登记程序详情,和可能的登录程序将记录在你的AUTH上下文中/var/log/auth.log logfile 详细方式。<br />
<br />
===== 验证 =====<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>LoginGraceTime 120</nowiki></code>'' <br />
|}<br />
默认设定,Ubuntu's的OpenSSH 服务配置从登录提示被显示的时间起到120 秒 (二分钟),直到在连接被 sshd 结束之前,用户必须开始登录过程。这个行为受登录时间指令的约束。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>LoginGraceTime 20</nowiki></code>''' <br />
|}<br />
<br />
<br />
在断开远程访问实用程序这前sshd服务将只为用户提供20秒等待。这可以有助于自动化阻遏,或者暴力攻击ssh,和拒绝服务式攻击(Dos)。<br />
<br />
LoginGraceTime<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>X11Forwarding yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
如果计算机提供传统服务,(E-Mail服务或Web服务),而且没有在以任何的形式 (像是 LTSP) 提供 X11 服务,那时X11数据封装将失去修改X11Forwarding指令到去除潜在的攻击向量,特别是连接到 ssh 用户。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>X11Forwarding no</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在X11 forwarding将无法有效的来自你的 sshd。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png '''警告''': 如果服务是基于使用X11服务的,或来自LTSP,那时X11 Forwarding将关闭,或者你将失去对此能力的支持!<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#Banner /etc/issue.net</nowiki></code>'' <br />
|}<br />
<br />
<br />
显示一个不欢迎的警示条,或更好的方法对于安全是件好事。它告知好奇的人,或者故意的未经许可的访客到你的OpenSSH服务器,因为远程访问你的计算机是需要经过许可的,并且需要用户授权。<br />
<br />
<br />
<br />
有一个预登陆的条目可以对你成功防范一个攻击者有很大的帮助,或别的组织未经许可的尝试经由ssh访问你的服务器。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Banner /etc/issue.net</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在激活那个显示条目 /etc/ssh/sshd_config,使用下列的程序和例子内容来创建实际的条目文件:<br />
<br />
使用sudo,和你喜欢的编辑软件,创建文件 /etc/issue,并把下面的文字写在里面作为预登陆告警条的起点:<br />
<br />
<pre><nowiki><br />
***************************************************************************<br />
NOTICE TO USERS<br />
This computer system is the private property of its owner, whether<br />
individual, corporate or government. It is for authorized use only.<br />
Users (authorized or unauthorized) have no explicit or implicit<br />
expectation of privacy.<br />
Any or all uses of this system and all files on this system may be<br />
intercepted, monitored, recorded, copied, audited, inspected, and<br />
disclosed to your employer, to authorized site, government, and law<br />
enforcement personnel, as well as authorized officials of government<br />
agencies, both domestic and foreign.<br />
By using this system, the user consents to such interception, monitoring,<br />
recording, copying, auditing, inspection, and disclosure at the<br />
discretion of such personnel or officials. Unauthorized or improper use<br />
of this system may result in civil and criminal penalties and<br />
administrative or disciplinary action, as appropriate. By continuing to<br />
use this system you indicate your awareness of and consent to these terms<br />
and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the<br />
conditions stated in this warning.<br />
****************************************************************************<br />
</nowiki></pre><br />
<code><nowiki>保存文件,并且创建一个符号连结到 /etc/issue.net 文件使用下列命令:</nowiki></code><br />
<br />
<code><nowiki>sudo ln -s /etc/issue /etc/issue.net</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
一旦重新启动sshd,所有的登陆尝试都会遇到上面的警告,并且有登陆提示符在这后面,所有的非授权访问者将受到一个清晰的消息"你的电脑只能通过授权才 能使用,不欢迎非授权使用,上面的警告条是丛US DEPARTMENT OF DEFENCE 的警告条的修改版本生成的,对于专业使用是足够合适的,可能对于个人用户就更加合适了。<br />
<br />
做为旁边注解,所有本地控制台应用程序也同样显示来自 /etc/issue 文件的信息,甚至在物理层使用这台电脑的人也会收到这样的警告。如果这不是你想要的行为,然后把条目的内容放在 /etc/issue文件中,而不是做一个到/etc.issue的一个符号联接,/etc/issue中没有任何文本。由于没有文字在 /etc/issue,警告将只出现在那些尝试访问系统的人的面前。<br />
<br />
=== 额外配置技巧 ===<br />
下面的内容是一些额外的暗示和一些配置一个更加安全的openssh安装的技巧,这些技巧利用一些不包含在默认的ubuntussh配置文件中的指令,并且提出其他加强你的ssh安装安全的方法。<br />
<br />
==== 允许和拒绝用户和用户组 ====<br />
在配置文件中你可以使用一些指令来允许或者拒绝一些特定用户或者用户组用ssh登陆.这个方法更加细致的控制哪些人可以通过ssh来进入你的Ubuntu电脑。<br />
<br />
例如,如果你想只允许jhendrix和svaughan通过ssh登陆,你可以向这样在你的/etc/ssh中使用allowusers指令。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''允许 jhendrix svaughan''' <br />
|}<br />
<br />
<br />
如果你不想让所有用户能过 ssh 登陆,除了使用者 wgates,或sballmer然后你可以使用DenyUsers命令添加到/etc/ssh/sshd_config中,像这样:<br />
<br />
{|border="1" cellspacing="0"<br />
|'''拒绝用户 wgates sballmer''' <br />
|}<br />
<br />
<br />
最后,再看一个例子,你可以这样配置你的OpenSSH服务,只有用户属于系统组才允许通过ssh 登录。在这个例子中,我们将执行一些必要手段只允许SSH的用户都是小组成员sshlogin。 sudo addgroup --gid 450 sshlogin sudo adduser <username> sshlogin。<br />
<br />
<code><nowiki>sudo addgroup --gid 450 sshlogin</nowiki></code><br />
<br />
<code><nowiki>sudo adduser <username> sshlogin</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
在以上的例子中是用'<username>'代替你的用户名加入到sshlogin系统组。最后,编辑你的 /etc/ssh/sshd_config,并增添allowgroups指令:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>AllowGroups sshlogin</nowiki></code>''' <br />
|}<br />
<br />
<br />
重新启动 sshd,并且只有属于sshlogin组的用户才可以通过ssh 登录到你的Ubuntu计算机。<br />
<br />
==== 启动 sshd来监听不同的端口 ====<br />
由于近来自动扫描ssh和暴力攻击工具的大量增长,很多装有ssh的用户和管理员决定给ssh用一个非标准的tcp端口,标准的sshd侦听端口是 tcp/22,并且暴力扫描攻击工具都典型的被配置成侦听这个端口用来查找后门。<br />
<br />
尽管从使用简单密码的ssh登陆切换到使用基于键盘方式的登陆,就象在指南中下部分我们要讨论的显著减少了自动工具猜测出一个正确的在你的系统的登陆的机会,一些人觉得加入更多偏僻字的层数可能更会增强安全性。<br />
<br />
如果你曾考虑过在非标准端口上运行的你的sshd分支,例如一个常量需要使用-p或者-P来切换不同的ssh工具,或者通过修改配置文件这种更长久的方式来检验端口改变的正确,并且接受那些协议,然后改变侦听端口是十分琐碎的。<br />
<br />
仅仅增加一个或更多的端口在你的 /etc/ssh/sshd_config 文件中,因此:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
如果你希望侦听tcp/22,和tcp/2222端口,例如,局域网连接可以显示成传统方式,但可以响应外部联接tcp/2222端口而不在需要网络地址翻译规则,和连接你的路由器,随后双方只是增添指令到 /etc/ssh/sshd_config:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 22</nowiki></code>''' <br />
|-<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要忘记保存文件,和重新启动你的sshd指令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
为改变生效。<br />
<br />
=== 基于RSA key登陆 ===<br />
基于key的授权是可用的ssh授权方法中的一种,因此简单的密码(Ubuntu默认密码)和Kerberos标签。基于Key的验证的几个优点比密码验证更好,至于例子这个key的值就十分明显的很难被暴力破解,或以大量的关键字为条件来猜测弱密码。<br />
<br />
数字键也是如此,是对极其相似事物的一个比方,所以可以在可能出现弱密码的地方显示密码安全的程度。使用基于Key登录的ssh 是比使用弱密码的登录,普遍认为更安全的。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png ''注解''''':''' ''同时生成一套能够使用openssh的RSA key而不需要密码是可能的,简单讲,通过ssh登陆不要密码,这个指导书没有描述或者认定这种用法是很不安全的.如果这个缺少密码的key落入其他人手 中,就如你的授权一样,应此所有允许这些key的系统安全都很容易受到威胁,在一些情况下,例如不安全的群环境中,需要有完全没有密码的登陆,但是,这本 着到书没有解释制造这种key的过程。''<br />
<br />
'' ''<br />
<br />
这部分将说明启动基本Key登录的ssh ,生成一套公有/私有RSA密匙,并使用它们由OpenSSH登录你的Ubuntu计算机。<br />
<br />
==== 生成 RSA 密匙 ====<br />
第一步包括生成一组用于验证的RSA 密匙。代表性意思是,你将在想要通过某台电脑去远程登陆其他电脑的这台机器上做这些事情,但是这不是非常重要,因为你总是可以到处把你的密匙安装到需要的机器上。到生成一个RSA 公有/私有密匙,使用下列命令行:<br />
<br />
<code><nowiki>b@tsh:~ ssh-keygen -t rsa</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
你必须在一个位置保存你的密匙,和一串对应于你的密匙的passphrase(密码短语口令)注5。当选择passphrase对于密匙时,应选择非常坚 固的passphrase,和便宜于记忆的,和记录它的位置的安全。这passphrase必须使用钥匙,在每次你要登录到一个基于密匙的系统:<br />
<br />
<pre><nowiki><br />
生成公有/私有RSA密匙对。<br />
进入保证密匙的文件(/home/b/.ssh/id_rsa):<br />
进入passphrase(empty for no passphrase):<br />
再次进入同一passphrase:<br />
你的验证文件保存在/home/b/.ssh/id_rsa.<br />
你的公有密匙保存在 /home/b/.ssh/id_rsa.pub.<br />
</nowiki></pre><br />
祝贺你现在已经有了密匙组。现在布置你的系统已允许你的登录它们。<br />
<br />
==== 在远程电脑寄存密匙 ====<br />
<code><nowiki>假设你想使用key的远程ubuntu已经运行了ssh后台程序,接下来放置你自己key对的公共部分在那些电脑上是十分简单的,例如,如果你喜 欢开始用基于key的方式登陆一个叫madsion的远程电脑,并且madsion正在运行sshd,并且能够用名字通过网络来到达这台机器,就可以很简 单的用sshcopy这个命令来恰当的放置你的key:</nowiki></code><br />
<br />
<code><nowiki>ssh-copy-id -i ~/.ssh/id_rsa.pub b@madison</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 登录测试 ====<br />
接下来, 你将要登录测试,配置连接到机器并使用你的passphrase来解开密匙:<br />
<br />
<code><nowiki>ssh madison</nowiki></code><br />
<br />
你会看到一个要你给出key的passphrase的命令提示符:<br />
{|border="1" cellspacing="0"<br />
|Enter passphrase for key '/home/b/.ssh/id_rsa': <br />
|}<br />
<br />
<br />
输入你的passphrase,并把madison设置为允许从基于密匙的登录,你将要使用它登录。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png '''''注解'':''' 上述的例子只是:一个例子!代替用户名,在这个例子中,机器名用你自己实际的名字是为了增加你成功的机会。 ;-)<br />
<br />
==== 行不通的事! ====<br />
如果你不是被提示要求passphrase,而是仅仅得到<br />
{|border="1" cellspacing="0"<br />
|b@madison's password: <br />
|}<br />
<br />
<br />
提示同样使用密码登录,然后读取。有一些情况可以预防向上面提到的这种情况。在默认的Ubuntu安装里,上面的例子能够运行。如果不,下列各项条件,例如这些时常发生的原因:<br />
<br />
在远程计算机上,确认 /etc/ssh/sshd_config包含下列各项,和没有它们的注解;<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>PubkeyAuthentication yes</nowiki></code> <br />
|}<br />
<br />
<br />
如果没有加它们,或没有注解,那么重要启动sshd,并重新再试一个登录。如果你现在得到了passphrase的提示,那要祝贺你可以用密匙登录了!<br />
<br />
==== 从这里到那里? ====<br />
如过你已经成功建立了一个基于RAS密匙的登陆,你可能希望这是你Ubuntu系统上唯一可接受的授权方式,完全放弃弱密码授权.按照这个路线,将能确保自动暴力扫描和攻击工具对你的公共系统攻击更加困难,提前提醒,你一旦丢失了密匙,你会发现你自己也被关在系统外面!<br />
<br />
从通知你的sshd不允许弱密码,到只是简单的使用sudo和你喜欢的编辑软件编辑 /etc/ssh/sshd_config,和下列各项指令改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#PasswordAuthentication yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
by uncommenting it, and changing ''yes'' to ''no'':<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PasswordAuthentication no</nowiki></code>''' <br />
|}<br />
<br />
<br />
保存文件,并重新启动sshd以使弱密码验证无效。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png '''警告''' : 做二次,使弱密码验证无效行为,和没有使用密匙登录,或丢失了你的密匙,你并被锁在你的机器外面了。当然,你仍然可以经过控制台登录机器上,但这可能不是那么容易,如果你的电脑是500哩远呢!你已被再次警告这样是不行的''!''<br />
<br />
此外,你可以改变允许使用基于密匙的登录的登录指令,到执行策略为以基于密码的登录。你可以做这个通过改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>PermitRootLogin yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
to<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PermitRootLogin without-password</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要由于没有密码而被警告.这并不意味着一个人用root登陆的时候不需要提供密码,仅仅相当,这意味着没有人可以用密码认证的方法使用root来登陆,意味着用root登陆的时候可能只能使用公共密匙方式登陆。<br />
<br />
=== 资源 ===<br />
更多资源与高级配置OpenSSH的安全性在以下表格中。<br />
<br />
==== 本地系统资源 ====<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>man sshd</nowiki></code> || System manual page for the <code><nowiki>sshd</nowiki></code> server daemon <br />
|-<br />
|<code><nowiki>man sshd_config</nowiki></code> || System manual page for the <code><nowiki>/etc/ssh/sshd_config</nowiki></code> configuration file <br />
|-<br />
|<code><nowiki>man ssh-copy-id</nowiki></code> || System manual page for the <code><nowiki>ssh-copy-id</nowiki></code> application <br />
|-<br />
|<code><nowiki>man ssh-keygen</nowiki></code> || System manual page for the <code><nowiki>ssh-keygen</nowiki></code> application <br />
|-<br />
|<code><nowiki>/etc/ssh/sshd_config</nowiki></code> || The OpenSSH Secure Shell Daemon (<code><nowiki>sshd</nowiki></code>) configuration file <br />
|}<br />
==== WWW Resources ====<br />
[http://www.debian-administration.org/articles/87 Keeping SSH access secure]<br />
<br />
[http://www.openssh.org/ OpenSSH Website]<br />
<br />
[http://www.debian-administration.org/articles/152 Password-less logins with OpenSSH]<br />
<br />
注1: 它是第一个既能用于数据加密也能用于数字签名的算法。它易于理解和操作,也很流行。算法的名字以发明者的名字命名:Ron Rivest, Adi Shamir 和Leonard Adleman。但RSA的安全性一直未能得到理论上的证明。它经历了各种攻击,至今未被完全攻破。<br />
<br />
注2: (rcp) 远端复制协议。该协议允许用户从网络的一个远端主机或者服务器上的文件系统中上载和下载文件。远端复制协议使用TCP协议来确保数据传输的可靠性。<br />
<br />
注3: 原处为"inetd" 意思就是监视一些网络请求的守护进程,其根据网络请求来调用相应的服务进程来处理连接请求。<br />
<br />
注4: xinetd(eXtended InterNET services daemon)提供类似于inetd+tcp_wrapper的功能,但是更加强大和安全。<br />
<br />
注5: 相对“密码”(password)而言,密码短语(passphrase)口令以其更为严密的安全性正受到IT界的广泛关注。在功能上,passphrase同密码一样,只是长度较密码长。通常passphrase使用4到5个单词取代原来数字、字母结合的方式。</div>Nakedpighttps://wiki.ubuntu.org.cn/index.php?title=OpenSSH%E9%AB%98%E7%BA%A7%E6%95%99%E7%A8%8B&diff=22804OpenSSH高级教程2007-06-07T11:55:27Z<p>Nakedpig:/* OpenSSH 服务 (sshd) */</p>
<hr />
<div>== OpenSSH 高级教程 ==<br />
<br />
原文出处:官方Wiki<br />
<br />
原文作者:<br />
<br />
授权许可:<br />
* [http://creativecommons.org/licenses/by-sa/2.0/ 创作共用协议Attribution-ShareAlike 2.0]<br />
* [http://www.gnu.org/copyleft/fdl.html GNU自由文档许可证]<br />
<br />
翻译人员:fiftymetre<br />
<br />
校正人员:<br />
<br />
贡献人员:<br />
<br />
适用版本:<br />
<br />
文章状态:等待校正<br />
----<br />
<br />
译者的话:第一次翻译这英文文章,译的不好的地方也许大家包含,我会努力在下一章中尽我所能的提高翻译质量。翻译这篇文章时,还特意找一了本“SSH权威指南”研究了一下,以前在win下都是用SSH Secure Shell来跟ubuntn来传文件的呵呵。但ubuntu6.06桌面版本默认安装却没有安装SSH。<br />
----<br />
<br />
<br />
=== 介绍 ===<br />
介绍 这篇指南由浅入深的介绍属于标准Ubuntu OpenSSH服务的默认配置和高级设置。这篇文章将详细论述server-side(服务器端)配置指导,并解释了利用Rivest Shamir Adleman (RSA) 算法(注1)生成密钥登陆 OpenSSH 服务器与明文密码的区别.附加的资源为OpenSSH 索引在指南部分。<br />
<br />
<br />
<br />
=== 面向读者 ===<br />
适当的设定这篇文章里的参数 ,读者应该是一个善于使用命令行程序的Ubuntu用户,使用bash环境,并在基于控制台的文本编辑器程序里把系统配置文件编辑成他们的首选设置,另 外,读者应该知道如何启动和关闭系统,并且基本的了解OpenSSH 程序包的安装,及其目的。<br />
<br />
<br />
<br />
=== 关于 OpenSSH ===<br />
OpenSSH OpenSSH是一种可以自由获得的安全Shell (SSH)协议族工具用来操作控制电脑,或在电脑之间传送文件。传统的工具要完成这样的功能得使用telnet(终端仿真协议),或极不安全的rcp(注 2),并由此来传送用户的密码口令。OpenSSH 提供一种无交互后台程序服务,和可以容易使用的用户工具,来加密远程控制装置,和传输文件操作,由此来代替原来的类似服务。<br />
<br />
<br />
<br />
=== OpenSSH 服务 (sshd) ===<br />
OpenSSH 服务,SSH,是作为代表性地独立守护程序,然而如果愿意的话也可以让该服务成为按需访问的策略(as- needed basis)的网络守护进程,来监视一些网络请求的守护进程(注3),或更进一步的扩展网络守护进程,或同等安全的, xinetd(注 4)。OpenSSH 服务配置经过 file /etc/ssh/sshd_config 目录创建。这部分内容将讨论默认安装配置文件,和告诉他们如 何做某些修改来得到更安全的 sshd。首先来看默认设置(in italics, such as Port 22)的简单说明,根据建议设置 (in bold, such as Protocol 2)介绍来增强安全防护。<br />
<br />
给你的OpenSSH 安装中改变 sshd的结构,首先制做备份你的原始 /etc/ssh/sshd_config 文件,在终端shell中输入下列命令:<br />
<br />
<code><nowiki>sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
你可以随意的选择保存原始文件的存取模式 使用下列命令:<br />
<br />
<code><nowiki>sudo chmod a-w /etc/ssh/sshd_config.original</nowiki></code><br />
<br />
以这样备份配置文件的方式被认为是最好的练习管理你的Ubuntu GNU/Linux system的方法。如果因为一些原因你需要恢复到原始 的配置,你可以很方便的,并且无论何时你造成一个错误,或执行了无法返回的错配置应用程序,你将总是可以返回到你的原始文件,以提供你在返回它(原始配置 文件)之前已经向后支持它。<br />
<br />
现在你已经保存了原始的 /etc/ssh/sshd_config 文件,你可以修改或替换文件的默认值和设定,和建议设定。在你改变任何设定到产生任何结果,你必须保存 /etc/ssh/sshd_config 文件,和重新启动 sshd 使用下命令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 建议 OpenSSH 服务设定 ====<br />
Ubuntu的OpenSSH的实现使用的默认 /etc/ssh/sshd_config 配置文件比其他GNU linux发行版还要更安全。但是还可以进一步提高现有的安全程度,而且那些建议在这里实被提到。在特别情况下一些变化对你可能是不适当的。使用提供的设 置来做出最有利的安全性抉择,还有你环境的可用性。<br />
<br />
===== 登录 =====<br />
{|border="1" cellspacing="0"<br />
|登录级别''<code><nowiki> </nowiki></code>''信息 <br />
|}<br />
默认设定允许 sshd 记录 AUTH 设备的syslog(系统日志),在信息级别。如果使用默认设置的 ssh 远程访问你的Ubuntu电脑,你应该考虑直接抛出LogLevel的日志详细级别给VERBOSE,因为这样你可以获得详细的关于所有企图和成功ssh登记。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|详细登录级别 <br />
|}<br />
<br />
<br />
现在所有ssh 登记程序详情,和可能的登录程序将记录在你的AUTH上下文中/var/log/auth.log logfile 详细方式。<br />
<br />
===== 验证 =====<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>LoginGraceTime 120</nowiki></code>'' <br />
|}<br />
默认设定,Ubuntu's的OpenSSH 服务配置从登录提示被显示的时间起到120 秒 (二分钟),直到在连接被 sshd 结束之前,用户必须开始登录过程。这个行为受登录时间指令的约束。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>LoginGraceTime 20</nowiki></code>''' <br />
|}<br />
<br />
<br />
在断开远程访问实用程序这前sshd服务将只为用户提供20秒等待。这可以有助于自动化阻遏,或者暴力攻击ssh,和拒绝服务式攻击(Dos)。<br />
<br />
LoginGraceTime<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>X11Forwarding yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
如果计算机提供传统服务,(E-Mail服务或Web服务),而且没有在以任何的形式 (像是 LTSP) 提供 X11 服务,那时X11数据封装将失去修改X11Forwarding指令到去除潜在的攻击向量,特别是连接到 ssh 用户。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>X11Forwarding no</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在X11 forwarding将无法有效的来自你的 sshd。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png '''警告''': 如果服务是基于使用X11服务的,或来自LTSP,那时X11 Forwarding将关闭,或者你将失去对此能力的支持!<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#Banner /etc/issue.net</nowiki></code>'' <br />
|}<br />
<br />
<br />
显示一个不欢迎的警示条,或更好的方法对于安全是件好事。它告知好奇的人,或者故意的未经许可的访客到你的OpenSSH服务器,因为远程访问你的计算机是需要经过许可的,并且需要用户授权。<br />
<br />
<br />
<br />
有一个预登陆的条目可以对你成功防范一个攻击者有很大的帮助,或别的组织未经许可的尝试经由ssh访问你的服务器。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Banner /etc/issue.net</nowiki></code>''' <br />
|}<br />
<br />
<br />
现在激活那个显示条目 /etc/ssh/sshd_config,使用下列的程序和例子内容来创建实际的条目文件:<br />
<br />
使用sudo,和你喜欢的编辑软件,创建文件 /etc/issue,并把下面的文字写在里面作为预登陆告警条的起点:<br />
<br />
<pre><nowiki><br />
***************************************************************************<br />
NOTICE TO USERS<br />
This computer system is the private property of its owner, whether<br />
individual, corporate or government. It is for authorized use only.<br />
Users (authorized or unauthorized) have no explicit or implicit<br />
expectation of privacy.<br />
Any or all uses of this system and all files on this system may be<br />
intercepted, monitored, recorded, copied, audited, inspected, and<br />
disclosed to your employer, to authorized site, government, and law<br />
enforcement personnel, as well as authorized officials of government<br />
agencies, both domestic and foreign.<br />
By using this system, the user consents to such interception, monitoring,<br />
recording, copying, auditing, inspection, and disclosure at the<br />
discretion of such personnel or officials. Unauthorized or improper use<br />
of this system may result in civil and criminal penalties and<br />
administrative or disciplinary action, as appropriate. By continuing to<br />
use this system you indicate your awareness of and consent to these terms<br />
and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the<br />
conditions stated in this warning.<br />
****************************************************************************<br />
</nowiki></pre><br />
<code><nowiki>保存文件,并且创建一个符号连结到 /etc/issue.net 文件使用下列命令:</nowiki></code><br />
<br />
<code><nowiki>sudo ln -s /etc/issue /etc/issue.net</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
一旦重新启动sshd,所有的登陆尝试都会遇到上面的警告,并且有登陆提示符在这后面,所有的非授权访问者将受到一个清晰的消息"你的电脑只能通过授权才 能使用,不欢迎非授权使用,上面的警告条是丛US DEPARTMENT OF DEFENCE 的警告条的修改版本生成的,对于专业使用是足够合适的,可能对于个人用户就更加合适了。<br />
<br />
做为旁边注解,所有本地控制台应用程序也同样显示来自 /etc/issue 文件的信息,甚至在物理层使用这台电脑的人也会收到这样的警告。如果这不是你想要的行为,然后把条目的内容放在 /etc/issue文件中,而不是做一个到/etc.issue的一个符号联接,/etc/issue中没有任何文本。由于没有文字在 /etc/issue,警告将只出现在那些尝试访问系统的人的面前。<br />
<br />
=== 额外配置技巧 ===<br />
下面的内容是一些额外的暗示和一些配置一个更加安全的openssh安装的技巧,这些技巧利用一些不包含在默认的ubuntussh配置文件中的指令,并且提出其他加强你的ssh安装安全的方法。<br />
<br />
==== 允许和拒绝用户和用户组 ====<br />
在配置文件中你可以使用一些指令来允许或者拒绝一些特定用户或者用户组用ssh登陆.这个方法更加细致的控制哪些人可以通过ssh来进入你的Ubuntu电脑。<br />
<br />
例如,如果你想只允许jhendrix和svaughan通过ssh登陆,你可以向这样在你的/etc/ssh中使用allowusers指令。<br />
<br />
<br />
{|border="1" cellspacing="0"<br />
|'''允许 jhendrix svaughan''' <br />
|}<br />
<br />
<br />
如果你不想让所有用户能过 ssh 登陆,除了使用者 wgates,或sballmer然后你可以使用DenyUsers命令添加到/etc/ssh/sshd_config中,像这样:<br />
<br />
{|border="1" cellspacing="0"<br />
|'''拒绝用户 wgates sballmer''' <br />
|}<br />
<br />
<br />
最后,再看一个例子,你可以这样配置你的OpenSSH服务,只有用户属于系统组才允许通过ssh 登录。在这个例子中,我们将执行一些必要手段只允许SSH的用户都是小组成员sshlogin。 sudo addgroup --gid 450 sshlogin sudo adduser <username> sshlogin。<br />
<br />
<code><nowiki>sudo addgroup --gid 450 sshlogin</nowiki></code><br />
<br />
<code><nowiki>sudo adduser <username> sshlogin</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
在以上的例子中是用'<username>'代替你的用户名加入到sshlogin系统组。最后,编辑你的 /etc/ssh/sshd_config,并增添allowgroups指令:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>AllowGroups sshlogin</nowiki></code>''' <br />
|}<br />
<br />
<br />
重新启动 sshd,并且只有属于sshlogin组的用户才可以通过ssh 登录到你的Ubuntu计算机。<br />
<br />
==== 启动 sshd来监听不同的端口 ====<br />
由于近来自动扫描ssh和暴力攻击工具的大量增长,很多装有ssh的用户和管理员决定给ssh用一个非标准的tcp端口,标准的sshd侦听端口是 tcp/22,并且暴力扫描攻击工具都典型的被配置成侦听这个端口用来查找后门。<br />
<br />
尽管从使用简单密码的ssh登陆切换到使用基于键盘方式的登陆,就象在指南中下部分我们要讨论的显著减少了自动工具猜测出一个正确的在你的系统的登陆的机会,一些人觉得加入更多偏僻字的层数可能更会增强安全性。<br />
<br />
如果你曾考虑过在非标准端口上运行的你的sshd分支,例如一个常量需要使用-p或者-P来切换不同的ssh工具,或者通过修改配置文件这种更长久的方式来检验端口改变的正确,并且接受那些协议,然后改变侦听端口是十分琐碎的。<br />
<br />
仅仅增加一个或更多的端口在你的 /etc/ssh/sshd_config 文件中,因此:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
如果你希望侦听tcp/22,和tcp/2222端口,例如,局域网连接可以显示成传统方式,但可以响应外部联接tcp/2222端口而不在需要网络地址翻译规则,和连接你的路由器,随后双方只是增添指令到 /etc/ssh/sshd_config:<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>Port 22</nowiki></code>''' <br />
|-<br />
|'''<code><nowiki>Port 2222</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要忘记保存文件,和重新启动你的sshd指令:<br />
<br />
<code><nowiki>sudo /etc/init.d/ssh restart</nowiki></code><br />
<br />
为改变生效。<br />
<br />
=== 基于RSA key登陆 ===<br />
基于key的授权是可用的ssh授权方法中的一种,因此简单的密码(Ubuntu默认密码)和Kerberos标签。基于Key的验证的几个优点比密码验证更好,至于例子这个key的值就十分明显的很难被暴力破解,或以大量的关键字为条件来猜测弱密码。<br />
<br />
数字键也是如此,是对极其相似事物的一个比方,所以可以在可能出现弱密码的地方显示密码安全的程度。使用基于Key登录的ssh 是比使用弱密码的登录,普遍认为更安全的。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png ''注解''''':''' ''同时生成一套能够使用openssh的RSA key而不需要密码是可能的,简单讲,通过ssh登陆不要密码,这个指导书没有描述或者认定这种用法是很不安全的.如果这个缺少密码的key落入其他人手 中,就如你的授权一样,应此所有允许这些key的系统安全都很容易受到威胁,在一些情况下,例如不安全的群环境中,需要有完全没有密码的登陆,但是,这本 着到书没有解释制造这种key的过程。''<br />
<br />
'' ''<br />
<br />
这部分将说明启动基本Key登录的ssh ,生成一套公有/私有RSA密匙,并使用它们由OpenSSH登录你的Ubuntu计算机。<br />
<br />
==== 生成 RSA 密匙 ====<br />
<code><nowiki>第一步包括生成一组用于验证的RSA 密匙。代表性意思是,你将在想要通过某台电脑去远程登陆其他电脑的这台机器上做这些事情,但是这不是非常重要,因为你总是可以到处把你的密匙安装到需要的机器上。到生成一个RSA 公有/私有密匙,使用下列命令行:</nowiki></code><br />
<br />
<code><nowiki>b@tsh:~ ssh-keygen -t rsa</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
你必须在一个位置保存你的密匙,和一串对应于你的密匙的passphrase(密码短语口令)注5。当选择passphrase对于密匙时,应选择非常坚 固的passphrase,和便宜于记忆的,和记录它的位置的安全。这passphrase必须使用钥匙,在每次你要登录到一个基于密匙的系统:<br />
<br />
<pre><nowiki><br />
生成公有/私有RSA密匙对。<br />
进入保证密匙的文件(/home/b/.ssh/id_rsa):<br />
进入passphrase(empty for no passphrase):<br />
再次进入同一passphrase:<br />
你的验证文件保存在/home/b/.ssh/id_rsa.<br />
你的公有密匙保存在 /home/b/.ssh/id_rsa.pub.<br />
</nowiki></pre><br />
祝贺你现在已经有了密匙组。现在布置你的系统已允许你的登录它们。<br />
<br />
==== 在远程电脑寄存密匙 ====<br />
<code><nowiki>假设你想使用key的远程ubuntu已经运行了ssh后台程序,接下来放置你自己key对的公共部分在那些电脑上是十分简单的,例如,如果你喜 欢开始用基于key的方式登陆一个叫madsion的远程电脑,并且madsion正在运行sshd,并且能够用名字通过网络来到达这台机器,就可以很简 单的用sshcopy这个命令来恰当的放置你的key:</nowiki></code><br />
<br />
<code><nowiki>ssh-copy-id -i ~/.ssh/id_rsa.pub b@madison</nowiki></code><br />
<br />
<code><nowiki></nowiki></code><br />
<br />
==== 登录测试 ====<br />
接下来, 你将要登录测试,配置连接到机器并使用你的passphrase来解开密匙:<br />
<br />
<code><nowiki>ssh madison</nowiki></code><br />
<br />
你会看到一个要你给出key的passphrase的命令提示符:<br />
{|border="1" cellspacing="0"<br />
|Enter passphrase for key '/home/b/.ssh/id_rsa': <br />
|}<br />
<br />
<br />
输入你的passphrase,并把madison设置为允许从基于密匙的登录,你将要使用它登录。<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png '''''注解'':''' 上述的例子只是:一个例子!代替用户名,在这个例子中,机器名用你自己实际的名字是为了增加你成功的机会。 ;-)<br />
<br />
==== 行不通的事! ====<br />
如果你不是被提示要求passphrase,而是仅仅得到<br />
{|border="1" cellspacing="0"<br />
|b@madison's password: <br />
|}<br />
<br />
<br />
提示同样使用密码登录,然后读取。有一些情况可以预防向上面提到的这种情况。在默认的Ubuntu安装里,上面的例子能够运行。如果不,下列各项条件,例如这些时常发生的原因:<br />
<br />
在远程计算机上,确认 /etc/ssh/sshd_config包含下列各项,和没有它们的注解;<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>PubkeyAuthentication yes</nowiki></code> <br />
|}<br />
<br />
<br />
如果没有加它们,或没有注解,那么重要启动sshd,并重新再试一个登录。如果你现在得到了passphrase的提示,那要祝贺你可以用密匙登录了!<br />
<br />
==== 从这里到那里? ====<br />
如过你已经成功建立了一个基于RAS密匙的登陆,你可能希望这是你Ubuntu系统上唯一可接受的授权方式,完全放弃弱密码授权.按照这个路线,将能确保自动暴力扫描和攻击工具对你的公共系统攻击更加困难,提前提醒,你一旦丢失了密匙,你会发现你自己也被关在系统外面!<br />
<br />
从通知你的sshd不允许弱密码,到只是简单的使用sudo和你喜欢的编辑软件编辑 /etc/ssh/sshd_config,和下列各项指令改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>#PasswordAuthentication yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
by uncommenting it, and changing ''yes'' to ''no'':<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PasswordAuthentication no</nowiki></code>''' <br />
|}<br />
<br />
<br />
保存文件,并重新启动sshd以使弱密码验证无效。<br />
<br />
<br />
<br />
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png '''警告''' : 做二次,使弱密码验证无效行为,和没有使用密匙登录,或丢失了你的密匙,你并被锁在你的机器外面了。当然,你仍然可以经过控制台登录机器上,但这可能不是那么容易,如果你的电脑是500哩远呢!你已被再次警告这样是不行的''!''<br />
<br />
此外,你可以改变允许使用基于密匙的登录的登录指令,到执行策略为以基于密码的登录。你可以做这个通过改变:<br />
{|border="1" cellspacing="0"<br />
|''<code><nowiki>PermitRootLogin yes</nowiki></code>'' <br />
|}<br />
<br />
<br />
to<br />
{|border="1" cellspacing="0"<br />
|'''<code><nowiki>PermitRootLogin without-password</nowiki></code>''' <br />
|}<br />
<br />
<br />
不要由于没有密码而被警告.这并不意味着一个人用root登陆的时候不需要提供密码,仅仅相当,这意味着没有人可以用密码认证的方法使用root来登陆,意味着用root登陆的时候可能只能使用公共密匙方式登陆。<br />
<br />
=== 资源 ===<br />
更多资源与高级配置OpenSSH的安全性在以下表格中。<br />
<br />
==== 本地系统资源 ====<br />
{|border="1" cellspacing="0"<br />
|<code><nowiki>man sshd</nowiki></code> || System manual page for the <code><nowiki>sshd</nowiki></code> server daemon <br />
|-<br />
|<code><nowiki>man sshd_config</nowiki></code> || System manual page for the <code><nowiki>/etc/ssh/sshd_config</nowiki></code> configuration file <br />
|-<br />
|<code><nowiki>man ssh-copy-id</nowiki></code> || System manual page for the <code><nowiki>ssh-copy-id</nowiki></code> application <br />
|-<br />
|<code><nowiki>man ssh-keygen</nowiki></code> || System manual page for the <code><nowiki>ssh-keygen</nowiki></code> application <br />
|-<br />
|<code><nowiki>/etc/ssh/sshd_config</nowiki></code> || The OpenSSH Secure Shell Daemon (<code><nowiki>sshd</nowiki></code>) configuration file <br />
|}<br />
==== WWW Resources ====<br />
[http://www.debian-administration.org/articles/87 Keeping SSH access secure]<br />
<br />
[http://www.openssh.org/ OpenSSH Website]<br />
<br />
[http://www.debian-administration.org/articles/152 Password-less logins with OpenSSH]<br />
<br />
注1: 它是第一个既能用于数据加密也能用于数字签名的算法。它易于理解和操作,也很流行。算法的名字以发明者的名字命名:Ron Rivest, Adi Shamir 和Leonard Adleman。但RSA的安全性一直未能得到理论上的证明。它经历了各种攻击,至今未被完全攻破。<br />
<br />
注2: (rcp) 远端复制协议。该协议允许用户从网络的一个远端主机或者服务器上的文件系统中上载和下载文件。远端复制协议使用TCP协议来确保数据传输的可靠性。<br />
<br />
注3: 原处为"inetd" 意思就是监视一些网络请求的守护进程,其根据网络请求来调用相应的服务进程来处理连接请求。<br />
<br />
注4: xinetd(eXtended InterNET services daemon)提供类似于inetd+tcp_wrapper的功能,但是更加强大和安全。<br />
<br />
注5: 相对“密码”(password)而言,密码短语(passphrase)口令以其更为严密的安全性正受到IT界的广泛关注。在功能上,passphrase同密码一样,只是长度较密码长。通常passphrase使用4到5个单词取代原来数字、字母结合的方式。</div>Nakedpighttps://wiki.ubuntu.org.cn/index.php?title=Linux%E4%B8%8D%E6%98%AFWindows/zh&diff=20765Linux不是Windows/zh2007-05-28T06:17:47Z<p>Nakedpig:/* 问题 #4 为设计者而设计 */</p>
<hr />
<div>{{Translation}}<br />
{{From|http://linux.oneandoneis2.org/LNW.htm}}<br />
{{Translator|laborer ekeng Chronmancer Sterec Luofei}}<br />
{{Languages|Linux不是Windows}}<br />
<br />
<center class=""><br />
<p><i>在这篇文章中,我将用"Linux"表示GNU/Linux操作系统和各种FOSS(译注:自由、开源的软件,Free / Open Source Software)项目,这样读起来会顺畅些。<br />
</i><br />
</p><br />
<h1>[[image:tux.png]] != [[image:windows.png]]<br />
<br><br />
(Linux不是Windows)</h1><br />
<p style="text-align: center;"><small>[http://geekblog.oneandoneis2.org/index.php/2005/12/31/derived_works_aamp_translations Derived works]</small></p><br />
<div style="text-align: justify;"><br />
<p class="MsoNormal"><span style=""><br />
<br />
如果你跳转到了这个页面,那么十有八九你是一个Linux 的新用户,你正遇到许许多多的麻烦关于如何由Windows 转向Linux,这篇文章的目的正是向新手解释这个问题。由于这个大问题衍生出许多枝节,下面我将对此逐一进行讨论。</span></p><br />
<br />
<br />
<br />
<h3><b><span style="">问题一:Linux 和 Windows 根本不一样</span></b></h3><br />
<br />
<p class="MsoNormal"><span style=""><br />
你一定会惊讶于有这么多人对Linux 发出相似的抱怨,他们奔向Linux,盘算着找到一个免费的、开源版的Windows。通常,这正是那些狂热的Linux 使用者所告诉他们去期待的状况。然而这却是个似是而非的期待。<br />
</span></p><br />
<br />
<p class="MsoNormal"><span style=""><br />
人们尝试Linux 的原因不尽相同,但所有的原因都可以归结为一:他们希望 Linux 会比 windows 更优秀。正是出于这一点,Linux的小成本、更广泛的选择权、高性能和高安全性——当然,还有许多其它的方面——被作为与windows 比较时的衡量标准。往往每一个开始尝试Linux 的Windows 用户都是如此。</span></p><br />
<br />
<p class="MsoNormal"><span style=""><br />
这正是问题之所在。</span></p><br />
<br />
<p class="MsoNormal"><span style="">太多的人都忽略了这样一个事实:从逻辑上讲,在保持某样东西与被比较体完全相同的前提下,将其做得更好是绝无可能的。正如一个完美的复制品将与它的母版毫无差异,但是它不可能会超越原版。所以当你怀抱着linux 的使用方式该和使用 windows 差不多的观念而尝试 Linux ,并希望它能够做的更好,你便会无可避免的发现他们之间的不同,并且把这些不同之处看作是 Linux 的缺陷。</span></p><br />
<br />
<p class="MsoNormal"><span style=""><br />
举一个简单的例子,让我们来想一想驱动程序的升级吧:通常的情况下,倘若我们要在 windows 下升级某个硬件的驱动,我们需要去硬件制造商的网站上找到并下载新的驱动;然而在 Linux 下,我们只须简单地升级内核即可。</span></p><br />
<br />
<p class="MsoNormal"><span style=""><br />
这意味着在Linux 下,仅仅一次下载和升级便能提供所有适用的最新驱动,然而在 Windows 下我们却不得不浏览多个网站并分别下载升级程序。这是一个不同的过程。并且显然,这绝不会是一种糟糕的体验。然而却有很多人对此抱怨不停,只因为这不是他们习惯的方式。</span></p><br />
<br />
<p class="MsoNormal"><br />
或者从另一个更经常接触到的例子来看,想一想 Firefox ——开源软件伟大的成功例子、一个席卷全球的浏览器。它是通过模仿IE —— 那个“最流行的浏览器”而取得成功的吗?<br />
</p><br />
<br />
<p class="MsoNormal"><br />
不,它的成功是因为它比IE <span style="font-style: italic;">更好</span> , 它之所以 <span style="font-style: italic;">更好</span> 正是因为它 <span style="font-style: italic;">不同</span>. 它有标签式浏览,实时书签,内建搜索条,PNG支持,adblock扩展,以及其它美妙的东西。<span style="font-style: italic;">"查找"</span>工具条显示在底部的工具栏中,它能够查找你键入的内容并且以红色标识表示没有相匹配的内容。而IE没有标签页浏览,没有RSS功能,搜索条只能通过第三方扩展实现,它的查找对话框还得通过点击 <span style="font-style: italic;">"确认"</span>按钮开始查找,而且还要再点击一次<span style="font-style: italic;">"确认"</span>才能清除<span style="font-style: italic;">"未发现" </span>的错误提示。它明白无疑地证明了一个开源应用程序通过“不同”而做到了“更好”,依靠“更好”进而取得了成功。如果FF是一个IE的克隆,它必然早已微不足道地消逝在了IE的阴影之下。如果 Linux 是一个 Windows的克隆,同样的事情也会发生在 Linux 身上。<span style=""><br />
</span></p><br />
<br />
<p><span style=""><br />
因此,解决这个问题的关键在于:记住 Linux 中那些对于你的使用习惯来说熟悉或相同的部分,Linux <span style="font-weight: bold;">不是</span> 新版的 或 改进版的Windows。 积极地迎接那些不同之处,因为只有不同,Linux 才真正拥有闪耀出其光彩的机会。</span></p><br />
<br />
<h3><span style=""></span><span style=""><b>问题二 : Linux 和Windows <span style="font-style: italic;">太</span>不一样了</b></span></h3><br />
<br />
<p class="MsoNormal"><span style=""><br />
当人们期待着linux 有所特色的时候,又一个问题接踵而至。Linux 和Windows 实在是太不一样了,一些差异简直难以让人适应。也许最典型的例子就是可供linux 用户选择的东西实在是太多了。对于一个刚上手的windows 用户,他拥有一个经典 或 XP风格的桌面主题、写字板程序、IE浏览器,Outlook Express;然而对于一个初用linux 的家伙,他面前有上百种发行版供以挑选,此后,是Gnome 或者KDE 或者Fluxbox,Vi 或者emacs 或者kate,Konqueror 或者Opera 或者Firefox 或者Mozilla 或者其他随便什么带来的一系列选择,如此等等不一而足。</span></p><br />
<br />
<p class="MsoNormal"><span style=""><br />
windows用户不曾为了安装和使用(一个OS)而面对过如此丰富的选择, <i>“有必要来那么多种选择吗?”</i>这样的抱怨帖子很常见。</span></p><br />
<p class="MsoNormal">Linux <i><span style="">真的</span></i><span style=""> 和Windows 有那么大的区别吗?不管怎么说,它们都是操作系统。它们都做同样的工作:操作你的计算机,让你有个东西运行你的应用程序,自然它们多少都有些共通的地方吧? </span></p><br />
<p class="MsoNormal"><span style="">让我们从这个角度看问题:出门看看路上行驶的各种不同的车辆。所有的车辆不管是什么样的设计多少都有同样的目的:从路上把你由A处运到B处。注意它们有不同的设计。</span></p><br />
<p class="MsoNormal"><span style="">但是你会想,汽车之间的差异非常小:它们都有方向盘,脚踏板,变速杆,手闸,车窗和车门,油箱……如果你能够开这部车,你就能开任何一部车。</span></p><br />
<p class="MsoNormal"><span style="">确实如此。但你有没看见过有些人不开汽车,取而代之他们骑摩托车?</span></p><br />
<p class="MsoNormal"><span style="">从一个版本的windows切换到另一个版本就像从一辆汽车换到另外一辆汽车。Win95到Win98,老实说我说不出什么区别。Win98到WinXp,区别比较大但是也没有什么真正的重大区别。</span></p><br />
<p class="MsoNormal"><span style="">但是从windows 切换到Linux 就象从开汽车切换到骑摩托车。他们都是 操作系统/道路车辆。他们可能都使用同样的 硬件/道路。他们可能都提供一个运行应用程序的 环境/把你从甲地运到乙地 。但他们使用本质不同的两种方法达到目的。</span></p><br />
<p class="MsoNormal"><span style="">Windows/汽车对于病毒/小偷并不安全,除非你安装反病毒软件/锁上车门。Linux/摩托车却没有病毒/车门,所以即使你没有安装反病毒软件/锁车门也非常安全。</span></p><br />
<br />
<p class="MsoNormal"><span style="">让我们反过来看一看:</span></p><br />
<br />
<p class="MsoNormal"><span style="">Linux/汽车 从根本上用于多用户/乘客。Windows/摩托车 用于单用户/乘客。每个 Windows 用户/摩托车驾驶员每时每刻都要习惯集中精力控制他的 计算机/车辆。而一个 Linux 用户/汽车乘客 只要在以根用户登录/坐在驾驶座上时才要习惯去控制他的 计算机/车辆。<br />
</span></p><br />
<p class="MsoNormal"><span style="">通过两种不同的方法来达成同样的目标,他们各有长处和缺陷: 当载上一整个家庭的成员和大包小包的货物从甲地至乙地时,一辆车显然是明智的选择: 它有充裕座位以及足够的储存空间。而在单人从甲地到乙地的旅程中,摩托车则是更好的伴侣:它不怎么会遇上堵车,消耗的燃油也更少。</span></p><br />
<p class="MsoNormal"><span style="">无论选择了摩托或是汽车,仍有很多事情不会改变:你要把油加进油箱,把车开在同一条道上,必须遵守红绿灯和禁令,在转弯之前打转向灯,你也仍要遵守速度限制。</span></p><br />
<br />
<p class="MsoNormal"><span style="">但是也终究有很多情形不同了:汽车驾驶者不必带着安全盔开车,摩托骑手不用系安全带,开车的人转动方向盘来转弯,摩托车驾驶者则要匐下身子改变重心,开车的人裁油门踏板来加速,而摩托车通过手旋转握把来控制加速。</span></p><br />
<p class="MsoNormal"><span style="">一位汽车司机如果试图通过转移重心来拐弯,很快就会陷入一堆麻烦中。同样的,一个Windows 用户如果认为自己的经验可以直接派上用场,结果也会因为相同的原因而徒劳无获。事实上,较之电脑新手,一个Windows 高级用户在Linux 的使用过程中常遇上更多麻烦。那些根深蒂固的Windows 经验用户在面对问题时如果无法解决,常会觉得“如果我这么有知识的都搞不定,那新手就更不别想了”,因而得出的“Linux离桌面应用还有十万八千里呢”想法也便大错特错。</span></p><br />
<p class="MsoNormal"><span style="">解决方法在于,<br />
Windows用户必须意识到他只是一个有经验的Windows用户,而不是有经验的电脑用户,Windows用户必须意识到当自己在尝试Linux时,他又成了一个新手。</span></p><br />
<p class="MsoNormal"><span style=""></span></p><br />
<br />
<h3><b><span style="">问题三: 文化冲击</span></b><span style="font-weight: bold;"></span></h3><br />
<br />
<h3><span style="font-weight: bold;">Subproblem #3a: There <span style="font-style: italic;">is</span> a culture</span><b><span style=""></span></b><span style=""></span></h3><br />
<br />
<p class="MsoNormal"><span style="">Windows<br />
users are<br />
more or less in a customer-supplier relationship: They pay for<br />
software, for<br />
warranties, for support, and so on. They expect software to have a<br />
certain<br />
level of usability. They are therefore used to having rights with their<br />
software: They have paid for technical support and have every right to<br />
demand<br />
that they receive it. They are also used to dealing with entities<br />
rather than<br />
people: Their contracts are with a company, not with a person.</span></p><br />
<p class="MsoNormal"><span style="">Linux<br />
users are in<br />
more of a community. They don't have to buy the software, they don't<br />
have to<br />
pay for technical support. They download software for free &amp;<br />
use Instant<br />
Messaging and web-based forums to get help. They deal with people, not<br />
corporations.</span></p><br />
<br />
<p class="MsoNormal"><span style="">A Windows<br />
user will<br />
not endear himself by bringing his habitual&nbsp;attitudes over to<br />
Linux, to<br />
put it mildly.</span></p><br />
<p class="MsoNormal"><span style="">The<br />
biggest cause of<br />
friction tends to be in the online interactions: A "3a" user new to<br />
Linux asks<br />
for help with a problem he's having. When he doesn't get that help at<br />
what he<br />
considers an acceptable rate, he starts complaining and demanding more<br />
help.<br />
Because that's what he's used to doing with paid-for tech support.<br />
The<br />
problem&nbsp;is<br />
that this <i>isn't</i> paid-for support. This is a bunch<br />
of volunteers who are<br />
willing to help people with problems out of the goodness of their<br />
hearts. The<br />
new user has no right to demand anything from them, any more than<br />
somebody<br />
collecting for charity can demand larger donations from contributors.</span></p><br />
<p class="MsoNormal"><span style="">In much<br />
the same way, a<br />
Windows user is used to using commercial software. Companies don't<br />
release<br />
software until it's reliable, functional, and user-friendly enough. So<br />
this is<br />
what a Windows user tends to expect from software: It starts at version<br />
1.0.&nbsp;Linux<br />
software,<br />
however, tends to get released almost as soon as it's written: It<br />
starts at<br />
version 0.1. This way, people who really need the functionality can get<br />
it<br />
ASAP; interested developers can get involved in helping improve the<br />
code; and<br />
the community as a whole stays aware of what's going on.</span></p><br />
<p class="MsoNormal"><span style="">If a "3a"<br />
user runs<br />
into trouble with Linux, he'll complain: The software hasn't met his<br />
standards,<br />
and he thinks he has a right to expect that standard. His mood won't be<br />
improved when he gets sarcastic replies like <i>"I'd demand a<br />
refund if I<br />
were you"</i></span></p><br />
<p class="MsoNormal"><span style="">So, to<br />
avoid problem<br />
#3a: Simply remember that you haven't paid the developer who wrote the<br />
software<br />
or the people online who provide the tech support. They don't owe you<br />
anything.</span></p><br />
<br />
<p class="MsoNormal"><span style=""></span><b><span style=""></span></b></p><br />
<br />
3.其他问题:这是一种文化<br />
<br />
<p class="MsoNormal"><span style="">WINDOWS用户或多或少的处在一种消费者和提供者的关系,他们花钱买软件,获得授权,得到支持等等.他们希望软件能够有明确的可用性.因此他们习惯得到使用软件的权利,他们花钱去得到技术上的支持以及他们需要的权利,他们也得到了.他们也经常要与一些实体打交道:例如他们与一家公司签一份合同,而不是个人.</span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">LINUX用户有着更多的一致性.他们不需要花钱去买软件,不需要为得到技术上的支持而耗费财力.他们免费下载软件,并且利用快速通信和到论坛去寻求帮助.他们和个人打交道,而不是公司.</span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">一个Windows的用户如果只是把他的观点带到Linux中,那么他是不会喜欢上Linux的.要慢慢的改变观点. </span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">引起矛盾的最大原因是在在线交流方面:一个刚刚用Linux的3a用户在遇到问题时寻求帮助,当他没有得到他可以接受的答案的时候,他便开始抱怨并且想要得到更多的帮助.因为这正是他以前用付费的来获得帮助的方式.问题就是这不是付费提供帮助的系统.而是很多热心人发自内心的帮助其他人解决问题的系统.一个新的用户没有任何权利去向这些热心人索要帮助,这就如同一个想要得到施舍的人,还要求从捐赠者那里获得更多的捐赠品一样.</span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">相同的,一个Windows用户习惯了使用商业软件. 这些软件在没有做到足够的可靠性,功能性和对用户友好的截面前,公司是不会开放代码的.这正是Windows用户期待Linux下的软件的原因,从Linux1.0版本的软件开始,用户就希望尽快得到开放的代码.这样,真正需要这些的人就会很快的得到它,并且这也使开发者会在提高代码这方面感兴趣,因此整个团体就会知道接下来要做什么了.</span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">如果一个3a用户在使用Linux时遇到了困难,他会抱怨:这个软件没能满足我的需求.并且他认为他有权利得到这样的满足.他的情绪将会有所改进,如果他等到这样的带有讽刺性的回答:如果我是你,我要求退款!</span></p><br />
<br />
<br />
<p class="MsoNormal"><span style="">所以,对于3a用户,为了避免这些问题,应做到:只要记住,你并没有付给那些软件开发者或者在线帮你提供技术指导的人任何钱.他们并不欠你任何东西.</span></p><br />
<br />
<h3><b><span style="">Subproblem #3b: New vs. Old</span></b><span style=""></span></h3><br />
<br />
<p class="MsoNormal">&nbsp;Linux pretty<br />
much started out life as a<br />
hacker's hobby. It grew as it attracted more hobbyist hackers. It was<br />
quite some time before anybody but a geek stood a chance of getting a<br />
useable Linux installation working easily. Linux started out&nbsp;<span style="font-style: italic;">"By geeks, for geeks."</span><br />
And even today, the majority of established Linux users are<br />
self-confessed geeks.</p><br />
<p class="MsoNormal">And that's a pretty good<br />
thing: If you've got<br />
a problem with hardware or software, having a large number of geeks<br />
available to work on the solution is a definite plus.&nbsp;</p><br />
<p class="MsoNormal">But Linux has grown up<br />
quite a bit since its<br />
early days. There are distros that almost anybody can install, even<br />
distros that live on CDs and detect all your hardware for you without <span style="font-style: italic;">any</span><br />
intervention. It's become attractive to non-hobbyist users who are just<br />
interested in it because it's virus-free and cheap to upgrade. It's not<br />
uncommon for<br />
there to be friction<br />
between the two camps. It's important to bear in mind, however, that<br />
there's no real malice on either side: It's lack of understanding that<br />
causes the problems.</p><br />
<p class="MsoNormal">Firstly, you get the<br />
hard-core geeks who<br />
still assume that everybody using Linux is a fellow geek. This means<br />
they expect a high level of knowledge, and often leads to accusations<br />
of arrogance,<br />
elitism, and rudeness. And in truth, sometimes that's what it is. But<br />
quite often, it's not:&nbsp;It's elitist to say&nbsp;<span style="font-style: italic;">"Everybody ought to know this"</span>.<br />
It's not elitist to say&nbsp;<span style="font-style: italic;">"Everybody<br />
knows this"</span> - quite the opposite.&nbsp;</p><br />
<br />
<p class="MsoNormal">Secondly,&nbsp;you get<br />
the new users who're trying to make the switch after a lifetime of<br />
using commercial OSes. These users are used to software that anybody<br />
can sit down &amp; use, out-of-the-box.</p><br />
<p class="MsoNormal">The issues arise<br />
because&nbsp;group 1 is made up of people who enjoy being able to<br />
tear their OS apart and rebuild it the way they like it, while group 2<br />
tends to be indifferent to the way the OS works, so long as it <span style="font-style: italic;">does</span> work.</p><br />
<p class="MsoNormal">A parallel situation that<br />
can emphasize the problems is Lego. Picture the following:</p><br />
<p class="MsoNormal">New: <span style="font-style: italic;">I wanted a new toy car, and<br />
everybody's raving about how great Lego cars can be. So I bought some<br />
Lego, but when I got home, I just had a load of bricks and cogs and<br />
stuff in the box. Where's my car??</span></p><br />
<p class="MsoNormal">Old: <span style="font-style: italic;">You have to build the car out of<br />
the bricks. That's the whole point of Lego.</span></p><br />
<br />
<p class="MsoNormal">New: <span style="font-style: italic;">What?? I don't know how to build<br />
a car. I'm not a mechanic. How am I supposed to know how to put it all<br />
together??</span></p><br />
<p class="MsoNormal">Old: <span style="font-style: italic;">There's a leaflet that came in<br />
the box. It tells you exactly how to put the bricks together to get a<br />
toy car. You don't need to know how, you just need to follow the<br />
instructions.</span></p><br />
<p class="MsoNormal">New: <span style="font-style: italic;">Okay, I found the instructions.<br />
It's going to take me hours! Why can't they just sell it as a toy car,<br />
instead of making you have to build it??</span></p><br />
<p class="MsoNormal">Old: <span style="font-style: italic;">Because not everybody wants to<br />
make a toy car with Lego. It can be made into anything we like. That's<br />
the whole point.</span></p><br />
<p class="MsoNormal">New: <span style="font-style: italic;">I still don't see why they can't<br />
supply it as a car so people who want a car have got one, and other<br />
people can take it apart if they want to. Anyway, I finally got it put<br />
together, but some bits come off occasionally. What do I do about this?<br />
Can I glue it?</span></p><br />
Old: <span style="font-style: italic;">It's Lego. It's<br />
designed to come apart. That's the whole point.</span><br />
<br />
<p class="MsoNormal">New: <span style="font-style: italic;">But I don't <span style="font-weight: bold;">want</span> it to come<br />
apart. I just want a toy car!</span></p><br />
Old: <span style="font-weight: bold;"><span style="font-style: italic;">Then why on Earth did you buy a<br />
box of Lego??</span></span><br />
<p class="MsoNormal">It's clear to just about anybody that<br />
Lego is not really aimed at<br />
people who just want a toy car. You don't get conversations like the<br />
above in real life. The whole point of Lego<br />
is that you have fun building it and you can make anything you like<br />
with it. If<br />
you've no interest in building anything, Lego's not for you. This is<br />
quite obvious.</p><br />
<p class="MsoNormal">As far as the long-time Linux user is<br />
concerned, the same holds true for Linux: It's an open-source,<br />
fully-customizeable set of software. That's the whole point. If you<br />
don't want to hack the components a bit, why bother to use it?</p><br />
<p class="MsoNormal">But there's been a lot of effort<br />
lately to make Linux more suitable for the non-hackers, a situation<br />
that's not a million miles away from selling pre-assembled Lego kits,<br />
in order to make it appeal to a wider audience. Hence you get<br />
conversations that aren't far away from the ones above:<br />
Newcomers&nbsp;complain about the existence of what the established<br />
users consider to be fundamental features, and resent having the read a<br />
manual to get something working. &nbsp;But complaining that there<br />
are too many distros; or that software has too<br />
many configuration options; or that it doesn't work perfectly<br />
out-of-the-box; is like complaining that Lego can be made into too many<br />
models, and not liking the fact that it can be broken down into bricks<br />
and built into&nbsp;many other things.</p><br />
<br />
<p class="MsoNormal">So, to avoid problem #3b: Just<br />
remember that what Linux seems to be now is <span style="font-weight: bold;">not</span><br />
what Linux was in the past. The largest and most necessary part of the<br />
Linux community, the hackers and the developers, like Linux <span style="font-weight: bold;">because</span> they can fit<br />
it together the way they like; they don't like it in <span style="font-weight: bold;">spite</span> of having to<br />
do all the assembly before they can use it.</p><br />
<p class="MsoNormal"></p><br />
<br />
子问题 #3b:新用户 vs. 老用户<br />
<br />
Linux几乎是因黑客的业余爱好而诞生的。它的成长也使得易于它吸引了更多志同道合的黑客们。Linux在获得一个易于使用的可用安装程序前一直默默无闻。在相当长的时间里,它在大众眼中只是一个奇客而已。可以说Linux“始于奇客,馈于奇客”。直至今日,大多数Linux的老用户仍自认为是奇客。<br />
<br />
这是件非常好的事情:如果你在硬件或软件方面有问题,存在一大群奇客们不断探寻解决方案这个状况显然一种明显的优势。<br />
<br />
但长久以来Linux的成长仍旧十分有限。尽管存在一些可以被绝大多数安装的发行版本,甚至一些版本基于CD并且与用户使用的硬件并无冲突。当Linux开始因其无病毒和省级廉价而吸引一些非发烧友用户时,两大用户阵营间并不是罕有摩擦,但双方都明了一点:对方都没有恶意,仅仅是缺乏相互理解而已。<br />
<br />
首先,你面临的是核心奇客们仍然假设所有使用Linux的用户们都是奇客同志。这意味着他们认为所有人都对此有很深入的理解,这导致了他人控诉他们的一些行为是傲慢、自大和无礼的。事实上,有些时候如此。但大多时候却并非这样:“每个人都应知道”这样的善意表达被说成了“地球人都知道!”——大相径庭。<br />
<br />
其次,你面临着从使用的商用操作系统转投而来的新用户。这些用户已习惯使用人机界面友善的软件,他们也是不确定因素。<br />
<br />
这类问题起因于不同使用习惯的碰撞:第一类人沉醉于不断地按自己喜好重构系统,而第二类人对操作系统如何工作漠不关心,只要它能工作就好。<br />
<br />
在乐高(Lego)发生的类似的情况正好阐述这种问题。试想下面的情景:<br />
<br />
新用户(以下简称“新”):我想要一个新玩具汽车,每个人都因乐高汽车的优秀而着了迷。所以我也买了它,但当我到家后我才发现,我的盒子里只有积木和齿轮!我的车子在哪里?<br />
<br />
老用户(以下简称“老”):我要用造车而且要超脱于积木之外,这才是乐高的真谛。<br />
<br />
新:什么??我不知道应怎样拼装这个车子。我不是个机械师。为什么我应该知道如何组装它?<br />
<br />
老:盒子里有使用手册。它上面写着拼装车子的步骤。你不用知道原理,只要按照按部就班就好。<br />
<br />
新:好吧,我找到了步骤。这将占用我很多时间!为什么厂家不能装好了再卖给我,还得让我自己动手??<br />
<br />
老:并不是所有人都满足于将乐高做成玩具车。这些积木可以被我们组成万物。这才是游戏的真谛。<br />
<br />
新:我仍旧不明白为什么厂商不能给我们这种想要车子的人一个成品,如果那些喜欢动手的人高兴可以自己拆了它阿。无论如何,我还是将它组装起来了,尽管某些部件时不时地掉下来。我有什么方法可以解决吗?我能将它们粘起来吗?<br />
<br />
老:这就是乐高。他就是用来拆装的。这才使游戏的真谛。<br />
<br />
新:但我不希望总是拆拆装装,我仅仅希望一个玩具车而已!<br />
<br />
老:呃,欢迎您到地球来。你买的是乐高吗?<br />
<br />
很明显,对那些只想要一个玩具车的人来说,乐高并不是为他们准备的。上面的情景应该不会发生在你的生活中。乐高的价值在于你可以建造过程中体会乐趣而且你也可以将它组装成任何你想要的东西。如果你不想动手拼装,只能说乐高不适合你。这显而易见。<br />
<br />
由于长久以来一直关注Linux的老用户,同样的问题在Linux上体现越发明显:它是开源的、完全可定制的软件集。这才是真谛。如果你不想修改一些组件,为什么自找麻烦来使用它呢?<br />
<br />
与乐高出售成品玩具的做法略有相似,通过最近的一系列的成果提升了非黑客用户使用Linux的舒适性,这使得更广大的用户可以使用Linux。也正因如此,你仍可以听到与上面相似的对话,程度也仅是略有不同。新用户抱怨老用户只考虑基本特性,他们不得不通过阅读手册才能实现一些功能。对太多发行版本的抱怨,对软件过多配置选项的抱怨和对运行时时常报错的抱怨不正如对乐高有太多模块的抱怨一样忽略了它可以被用来按你想发拆装成事实吗?<br />
<br />
因此,为了避免问题#3b:请铭记现在的Linux已今非昔比。Linux社区最大的也是最关键的组成部分——黑客和开发者们,他们因Linux的可以按需定制而欢喜;他们也会可制定能力的丧失因而神伤。<br />
<br />
注:<br />
奇客:geek,词典中解释为因穿着不时尚和不懂得如何在社会中行事而作出一些怪事的人。现在指那些可以在电子和虚拟世界中非常有才华和想象力的发烧友。Geek宗教一般信仰科技或者颠覆科技。--chronmancer<br />
<br />
<h3><span style="font-weight: bold;">Problem #4: Designed for the designer</span></h3><br />
<br />
<p class="MsoNormal">In the car industry, you'll very<br />
rarely find that<br />
the person who designed the engine also designed the car interior: It<br />
calls for totally different skills. Nobody wants an engine that only <span style="font-style: italic;">looks</span> like it can<br />
go fast, and nobody wants an interior that works superbly but is<br />
cramped and ugly. And<br />
in the same way, in the software industry, the user interface (UI) is<br />
not usually created by the people who wrote the software.</p><br />
<br />
<p class="MsoNormal">In the Linux world, however, this is<br />
not so much<br />
the case: Projects frequently start out as one man's toy. He does<br />
everything himself, and therefore the interface has no need of any kind<br />
of <span style="font-style: italic;">"user friendly"</span><br />
features:<br />
The user knows everything there is to know about the software, he<br />
doesn't need help. Vi is a good example of software deliberately<br />
created for a user who already knows how it works: It's not unheard of<br />
for new users to reboot their computers because they couldn't figure<br />
out<br />
how else to get out of vi.</p><br />
<p class="MsoNormal">However, there is an important<br />
difference between<br />
a FOSS programmer and most commercial software writers: The software a<br />
FOSS programmer creates is software that he intends to use. So whilst<br />
the end result might not be as 'comfortable' for the novice user, they<br />
can draw some comfort in knowing that the software is designed by<br />
somebody who knows what the end-users needs are: He too is an end-user.<br />
This is very different from commercial software writers, who are making<br />
software for <span style="font-style: italic;">other<br />
people</span> to use: They are <span style="font-style: italic;">not</span> knowledgeable<br />
end-users.</p><br />
<p class="MsoNormal">So whilst vi has an interface that is<br />
hideously<br />
unfriendly to new users, it is still in use today because it is such a<br />
superb interface once you know how it works. Firefox was created by<br />
people who regularly browse the Web. The Gimp was built by people who<br />
use it to manipulate graphics files. And so on.</p><br />
<p class="MsoNormal">So Linux interfaces are frequently a<br />
bit of a<br />
minefield for the novice: Despite its popularity, vi should never be<br />
considered by a new user who just wants to quickly make a few changes<br />
to a file. And if you're using software early in its lifecycle,<br />
a&nbsp;polished, user-friendly interface is something you're likely<br />
to<br />
find only in the <span style="font-style: italic;">"ToDo"</span><br />
<br />
list: Functionality comes first. Nobody designs<br />
a killer interface and then tries to add functionality bit by bit. They<br />
create functionality, and then improve the interface bit by bit.</p><br />
<p class="MsoNormal">So to avoid #4 issues: Look for<br />
software that's<br />
specifically aimed at being easy for new users to use, or accept that<br />
some software that has a steeper learning curve than you're used to. To<br />
complain that vi isn't friendly enough for new users is to be laughed<br />
at for missing the point.</p><br />
<p class="MsoNormal"></p><br />
<br />
==问题 #4 为设计者而设计==<br />
<br />
在汽车工业中,你很难发现一个人即设计车辆引擎也设计车辆内饰:这些是完全不同的技能。没有人想要只是看起来可以跑得很快的引擎,同样也没有人想要一个做工出众但狭小且肮脏的内饰。基于同样的道理,在软件产业,用户界面(UI)往往不是由软件编程人员设计的。<br />
<br />
但在Linux的世界却大不相同:一个项目往往是因个人的兴趣而产生。个人也包办了所有的工作,因此这些项目的界面往往缺乏了“用户友好”的特性:用户对这个软件了如指掌,所以他也就不需要了帮助文件等。vi就是一个很好的例子,最初它的目标用户就是为那些了解它工作方式的人。因而设计者从来都没有想过如何用其他方式退出vi,所以新用户不得不靠重起计算机推出的事情时有发生。<br />
<br />
但是,FOSS程序员与商用软件程序员的一个最重大区别在于,FOSS程序员的作品都是他们自己想要使用的东西。因此当作品不能被新用户“舒适”的使用的同时,它又成为了最终用户最需要的东西:因为作者也是最终用的一员。商用软件的程序员却大不相同,他们总是为其他人编写软件,而且这些用户都不是专家。<br />
<br />
所尽管vi拥有拥有一个令新手望而生畏的界面,但它仍然在当今流行,这又归功于他的界面:当你熟悉后就会发现它原来无比强大。Firefox也是被经常浏览网页的人编写出来的。Gimp同样是出自经常处理图形文件的人之手。不胜枚举。<br />
<br />
Linux的界面对于新手而言同样的有些“危险”。尽管vi名声在外,但他仍然不在那些需要快速修改一些文件的新手的考虑之列。如果你在一个软件生命周期的早期使用它,光鲜亮丽且友善的用户界面永远只高挂在“计划”列表之上:功能优先。没有人先雇好装修队再去找楼盘,程序员们都是实现功能再不断改进界面。<br />
<br />
所以为了避免问题#4:寻找那些已便于上手为目的设计的软件,或者接受那些与你使用习惯急剧不同的软件。抱怨vi对新手不够友好只是舍本求末罢了。<br />
<br />
<h3>Problem #5: The myth of "user-friendly"</h3><br />
<br />
<p>This is a big one. It's a very big term in the computing<br />
world,<br />
"user-friendly". It's even the name of a particularly good webcomic.<br />
But it's a bad term.</p><br />
<p>The basic concept is good: That software be designed with the<br />
needs<br />
of the user in mind. But it's always addressed as a single concept,<br />
which it isn't.&nbsp;</p><br />
If you spend your entire life processing text files, your ideal<br />
software will be fast and powerful, enabling you to do the maximum<br />
amount of work for the minimum amount of effort. Simple keyboard<br />
shortcuts and mouseless operation will be of vital importance.<br><br />
<p>But if you very rarely edit text files, and you just want to<br />
write<br />
an occasional letter, the last thing you want is to struggle with<br />
learning keyboard shortcuts. Well-organized menus and clear icons in<br />
toolbars will be your ideal.&nbsp;</p><br />
<p>Clearly, software designed around the needs of the first user<br />
will<br />
not be suitable for the second, and vice versa. So how can any software<br />
be called "user-friendly", if we all have different needs?</p><br />
<br />
<p>The simple answer: User-friendly is a misnomer, and one that<br />
makes a complex situation seem simple.</p><br />
<p>What does "user-friendly" really mean? Well, in the context in<br />
which it is used, "user friendly" software means <span style="font-style: italic;">"Software that can be used to a<br />
reasonable level of competence by a user with no previous experience of<br />
the&nbsp;software."</span> This has the unfortunate effect of<br />
making lousy-but-familiar interfaces&nbsp;fall into the category of<br />
"user-friendly".&nbsp;</p><br />
<p></p><br />
<br />
<h3>"用户友好"的神话</h3><br />
<br />
在电脑世界里,“用户友好“是一个十分广泛的专有名词。甚至有一个网络笑话就叫这个名字。但这个词却名不副实。<br />
<br />
基本实现方法听起来似乎不错:软件的设计要从用户的想法和需要出发。这个方法一直都被认为是单一的实现办法,但事实并非如此。<br />
<br />
如果你一辈子都在进行文书处理的工作,理想的软件对你来说就是个快捷强大、能让你投入最小的精力来实现最大的工作效率的字处理软件。简单的键盘快捷键和无须鼠标的操作将是最基本的需求。<br />
<br />
但如果你很少做字处理的工作,你只是要写一封普通的信,那么你不会想着去学会那些键盘快捷键操作方法。排列有序的菜单和一目了然的工具栏图标就是你的理想环境。<br />
<br />
很明显,你为某个用户的需求所设计的软件可能对其他的用户来说并不合适。如此说来,若我们每个人都对软件有不一样的需求,那这些软件怎么能自称“用户友好”呢?<br />
<br />
简单来说:“用户友好”并非事实,只是为了让复杂的情况看上去变得简单一点而已。<br />
<br />
那么“用户友好”到底是什么意思呢?好吧,从那些使用这个词的文章中来看,“用户友好”的软件实际上意味着“该软件对那些以前从未使用这个软件的用户们来说也不是那么难上手“。这就使得那些看上去用户界面都差不多的软件都被归类为“用户友好“。<br />
<br />
<h3>Subproblem #5a: Familiar is friendly</h3><br />
<p>So it is that in most "user-friendly" text editors &amp;<br />
word<br />
processors, you Cut and Paste by using Ctrl-X and Ctrl-V. Totally<br />
unintuitive, but everybody's used to these combinations, so they count<br />
as a "friendly" combination.</p><br />
<p>So when somebody comes to vi and finds that it's "d<span style="font-style: italic;"></span>" to cut, and "p"<br />
to paste, it's not considered<br />
friendly: It's<br />
not what anybody is used to.</p><br />
<br />
<p>Is it superior? Well, actually, yes.&nbsp;</p><br />
<p>With the Ctrl-X approach, how do you cut a word from the<br />
document you're currently in? <span style="font-style: italic;">(No<br />
using the mouse!)</span></p><br />
From the start of the word, <span style="font-style: italic;">Ctrl-Shift-Right</span><br />
to select the word.&nbsp;<br><br />
Then <span style="font-style: italic;">Ctrl-X</span><br />
to cut it.<br />
<p>The vi approach? <span style="font-style: italic;">dw</span><br />
<br />
deletes the word.</p><br />
<p>How about cutting <span style="font-weight: bold;">five</span><br />
words with a Ctrl-X application?</p><br />
From the start of the words, <span style="font-style: italic;">Ctrl-Shift-Right</span><br><br />
<span style="font-style: italic;">Ctrl-Shift-</span><span style="font-style: italic;">Right</span><br><br />
<span style="font-style: italic;">Ctrl-Shift-</span><span style="font-style: italic;">Right</span><br><br />
<span style="font-style: italic;">Ctrl-Shift-</span><span style="font-style: italic;">Right</span><br><br />
<br />
<span style="font-style: italic;">Ctrl-Shift-</span><span style="font-style: italic;">Right</span><br><br />
<span style="font-style: italic;">Ctrl-X</span><br />
<p>And with vi?</p><br />
<p><span style="font-style: italic;">d5w</span></p><br />
<p>The vi approach is far more versatile and actually<br />
more&nbsp;intuitive: "X" and "V" are not obvious or memorable "Cut"<br />
and "Paste" commands, whereas "dw" to <span style="font-style: italic; font-weight: bold;">d</span>elete<br />
a <span style="font-style: italic; font-weight: bold;">w</span>ord,<br />
and "p" to <span style="font-style: italic; font-weight: bold;">p</span>ut<br />
it back is perfectly straightforward. But "X" and "V" are what we all<br />
know, so whilst vi is clearly superior, it's unfamiliar.<br />
Ergo, it<br />
is considered unfriendly. On no other basis, pure familiarity makes a<br />
Windows-like interface seem friendly. And as we learned in problem #1,<br />
Linux<br />
is necessarily different to Windows. Inescapably, Linux always appears<br />
less<br />
"user-friendly" than Windows.&nbsp;</p><br />
<br />
<p>To avoid #5a problems, all you can really do is try and<br />
remember<br />
that <span style="font-style: italic;">"user-friendly"</span><br />
doesn't mean <span style="font-style: italic;">"What I'm<br />
used to"</span>: Try doing things<br />
your usual way, and if it doesn't work, try and work out what a total<br />
novice would do.&nbsp;</p><br />
<p></p><br />
<h3>Subproblem #5b: Inefficient is friendly</h3><br />
<p>This is a sad but inescapable fact. Paradoxically, the harder<br />
you<br />
make it to access an application's functionality, the friendlier it can<br />
seem to be.&nbsp;</p><br />
<p>This is because friendliness is added to an interface by using<br />
simple, visible 'clues' - the more, the better. After all, if a<br />
complete novice to computers is put in front of a WYSIWYG word<br />
processor and asked to make a bit of text bold, which is more likely:</p><br />
<ul><br />
<li>He'll guess that <span style="font-style: italic;">"Ctrl-B"</span><br />
<br />
is the usual standard&nbsp;</li><br />
</ul><br />
<ul><br />
<li>He'll look for clues, and try clicking on the <span style="font-style: italic;">"Edit"</span> menu.<br />
Unsuccessful, he'll try the next likely one along the row of menus: <span style="font-style: italic;">"Format"</span>. The new<br />
menu has a <span style="font-style: italic;">"Font"</span><br />
option, which seems promising. And Hey! There's our <span style="font-style: italic;">"Bold"</span> option.<br />
Success!</li><br />
<br />
</ul><br />
<p>Next time you do any processing, try doing every job via the<br />
menus:<br />
No shortcut keys, and no toolbar icons. Menus all the way. You'll find<br />
you slow to a crawl, as every task suddenly demands a multitude of<br />
keystrokes/mouseclicks.</p><br />
Making software "user-friendly" in this fashion is like putting<br />
training wheels on a bicycle: It lets you get up &amp; running<br />
immediately, without any skill or experience needed. It's <span style="font-style: italic;">perfect</span> for a<br />
beginner. But nobody out there thinks that <span style="font-style: italic;">all</span> bicycles should<br />
be sold<br />
with<br />
training wheels: If you were given such a bicycle today, I'll wager the<br />
first<br />
thing you'd do is remove them for being unnecessary encumbrances:<br />
Once you know how to ride a bike, training wheels are unnecessary.<br />
<p>And in the same way, a great deal of Linux software is<br />
designed<br />
without "training wheels" - it's designed for users who already have<br />
some basic skills in place. After all, nobody's a permanent novice:<br />
Ignorance is short-lived, and knowledge is forever. So the software is<br />
designed with the majority in mind.&nbsp;</p><br />
<p>This might seem an excuse: After<br />
all, MS Word has all the friendly menus, <span style="font-style: italic;">and</span> it has toolbar<br />
buttons,<br />
<br />
<span style="font-style: italic;">and</span> it has<br />
shortcut keys. . . Best of all worlds, surely?<br />
Friendly&nbsp;<span style="font-weight: bold;">and</span><br />
efficient.</p><br />
<p>However, this has to be put into perspective: Firstly, the<br />
practicalities: having menus and toolbars and shortcuts and all would<br />
mean a lot of coding, and it's not like Linux developers all get paid<br />
for their time.&nbsp;Secondly, it still doesn't really take into<br />
account<br />
serious&nbsp;power-users: Very few professional wordsmiths use MS<br />
Word. Ever meet a coder who used MS Word? Compare that to how<br />
many use emacs &amp; vi.&nbsp;</p><br />
<p>Why is this? Firstly, because some "friendly"<br />
behaviour rules out efficient behaviour: See the "Cut&amp;Copy"<br />
example<br />
above. And secondly, because most of Word's functionality is buried in<br />
menus that you <span style="font-style: italic;">have</span><br />
<br />
to use:<br />
Only the most common functionality has those handy little buttons in<br />
toolbars at the top. The less-used functions that are still vital for<br />
serious users just take too long to access.</p><br />
<p>Something to bear in mind, however, is that "training wheels"<br />
are<br />
often available as "optional extras" for Linux software: They might not<br />
be obvious, but frequently they're available.</p><br />
<p>Take mplayer. You use it to play a video file by typing <span style="font-style: italic;">mplayer filename</span><br />
in a terminal. You fastforward &amp; rewind using the arrow keys<br />
and<br />
the PageUp &amp; PageDown keys. This is not overly "user-friendly".<br />
However, if you instead type <span style="font-style: italic;">gmplayer<br />
filename</span>, you'll get the graphical frontend, with all its<br />
nice, friendly , familiar buttons.</p><br />
<p>Take ripping a CD to MP3 (or Ogg): Using the command-line, you<br />
need<br />
to use cdparanoia to rip the files to disc. Then you need<br />
an&nbsp;encoder. . . It's a hassle, even if you know exactly how to<br />
use the<br />
packages <span style="font-style: italic;">(imho)</span>.<br />
So download<br />
<br />
&amp; install something like Grip. This is an easy-to-use graphical<br />
frontend that uses cdparanoia and encoders behind-the-scenes to make it<br />
really easy to rip CDs, and even has CDDB support to name the files<br />
automatically for you.&nbsp;</p><br />
<p>The same goes for ripping DVDs: The number of options to pass<br />
to<br />
transcode is a bit of a nightmare. But using dvd::rip to talk to<br />
transcode for you makes the whole thing a simple, GUI-based process<br />
which anybody can do.</p><br />
<p>So to avoid #5b issues: Remember that "training wheels" tend<br />
to<br />
be&nbsp;bolt-on extras in Linux, rather than being automatically<br />
supplied with the main product. And sometimes, "training wheels" just<br />
can't be part of the design.</p><br />
<p></p><br />
<h3>Problem #6: Imitation vs. Convergence</h3><br />
<p>An argument people often make when they find that Linux isn't<br />
the Windows clone they wanted is to insist that this is what Linux has<br />
been (or <span style="font-style: italic;">should</span><br />
have been) attempting to be since it was created, and that people who<br />
don't<br />
recognise this and help to make Linux more Windows-like are in the<br />
wrong. They draw on many arguments for this:</p><br />
<p style="font-style: italic;">Linux has gone from<br />
Command-Line- to Graphics-based interfaces, a clear attempt to copy<br />
Windows</p><br />
<br />
<p>Nice theory, but false: The original X windowing system was<br />
released in 1984, as the successor to the W windowing system ported to<br />
Unix in 1983. Windows 1.0 was released in 1985. Windows didn't really<br />
make it<br />
big until version 3, released in 1990 - by which time, X windows had<br />
for years been at the X11 stage we use today. Linux itself was only<br />
started in 1991. So Linux didn't create a GUI to copy Windows: It<br />
simply made use of a GUI that existed long before Windows.</p><br />
<p style="font-style: italic;">Windows 3 gave way to<br />
Windows 95 - making a huge level of<br />
changes to the UI that Microsoft has never equalled since. It had many<br />
new &amp; innovative features: Drag &amp; drop functionality;<br />
taskbars,<br />
and so on. All of which have since been copied by Linux, of course.</p><br />
<p>Actually. . . no. All the above existed prior to Microsoft<br />
making use<br />
of them. NeXTSTeP in particular was a hugely advanced (for the time)<br />
GUI, and it predated Win95 significantly - version 1 released in 1989,<br />
and the final version in 1995. </p><br />
<p style="font-style: italic;">Okay, okay, so Microsoft<br />
didn't think up the individual features that we think of as the Windows<br />
Look-and-Feel. But it still created <strong>a</strong><br />
Look-and-Feel, and Linux has been trying to imitate that ever since.</p><br />
<p>To debunk this, one must discuss the concept of <em>convergent<br />
evolution</em>.<br />
This is where two completely different and independent systems evolve<br />
over time to become very similar. It happens all the time in biology.<br />
For example, sharks and dolphins. Both are (typically) fish-eating<br />
marine organisms of about the same size. Both have dorsal fins,<br />
pectoral fins, tail fins, and similar, streamlined shapes.</p><br />
<br />
<p>However,<br />
sharks evolved from fish, while dolphins evolved from a land-based<br />
quadrupedal mammal of some sort. The reason they have very similar<br />
overall appearances is that they both evolved to be as efficient as<br />
possible at living within a marine environment. At no stage did<br />
pre-dolphins (the relative newcomers) look at sharks and think <em>"Wow,<br />
look at those fins. They work really well. I'll try and evolve some<br />
myself!"</em></p><br />
<p>Similarly,<br />
it's perfectly true to look at early Linux desktops and see FVWM and<br />
TWM and a lot of other simplistic GUIs. And then look at modern Linux<br />
desktops, and see Gnome &amp; KDE with their taskbars and menus and<br />
eye-candy. And yes, it's true to say that they're a lot more like<br />
Windows than they used to be.</p><br />
<p>But then, so is Windows: Windows 3.0 had no taskbar that I<br />
remember. And the Start menu? <span style="font-style: italic;">What</span><br />
Start menu?</p><br />
<p>Linux didn't have a desktop anything like modern Windows.<br />
Microsoft didn't either. Now they both do. What does this tell us?</p><br />
<p>It<br />
tells us that developers in both camps looked for ways of improving the<br />
GUI, and because there are only a limited number of solutions to a<br />
problem, they often used very similar methods. Similarity does not in<br />
any way prove or imply imitation. Remembering that will help you avoid<br />
straying into problem #6 territory.</p><br />
<p></p><br />
<br />
<h3>Problem #7: That FOSS thing.</h3><br />
<p>Oh, this causes problems. Not intrinsically: The software<br />
being free and open-source is a wonderful and immensely important part<br />
of the whole thing. But understanding just how different FOSS is from<br />
proprietary software can be too big an adjustment for some people to<br />
make.&nbsp;</p><br />
<p>I've already mentioned some instances of this: People thinking<br />
they can demand technical support and the like. But it goes far beyond<br />
that.&nbsp;</p><br />
<p>Microsoft's Mission Statement is <span style="font-style: italic;">"A computer on every desktop"</span><br />
- with the unspoken rider that each computer should be running Windows.<br />
Microsoft and Apple both sell operating systems, and both do their<br />
utmost to make sure their products get used by the largest number of<br />
people: They're businesses, out to make money.</p><br />
<p>And then there is FOSS. Which, even today, is almost entirely<br />
non-commercial.</p><br />
<p>Before you reach for your email client to tell me about Red<br />
Hat, Suse, Linspire and all:&nbsp;Yes, I know they "sell" Linux. I<br />
know they'd all love Linux to be<br />
adopted universally, especially their own flavour of it. But don't<br />
confuse the suppliers with the manufacturers. The<br />
Linux kernel was not created by a company, and is not maintained by<br />
people out to make a profit with it. The GNU tools were not created by<br />
a company, and are not maintained by people out to make a profit with<br />
them. The X11 windowing system. . . well, the most popular<br />
implementation is xorg right now, and the <span style="font-style: italic;">".org"</span> part should<br />
tell you<br />
all you need to know. Desktop software: Well, you might be able to make<br />
a case for KDE being commercial, since it's Qt-based. But Gnome,<br />
Fluxbox, Enlightenment, etc. are all non-profit. There <span style="font-style: italic;">are</span> people out to<br />
sell Linux, but they are very much the minority.</p><br />
<br />
<p>Increasing the number of end-users of proprietary software<br />
leads to a direct financial benefit to the company that makes it. This<br />
is simply not the case for FOSS: There is no direct benefit to any FOSS<br />
developer in increasing the userbase. Indirect benefits, yes: Personal<br />
pride; an increased potential for finding bugs; more likelihood of<br />
attracting new developers; possibly a chance of a good job offer; and<br />
so on.&nbsp;</p><br />
<p>But Linus Torvalds doesn't make money from increased Linux<br />
usage. Richard Stallman doesn't get money from increased GNU usage. All<br />
those servers running OpenBSD and OpenSSH don't put a penny into the<br />
OpenBSD project's pockets. And so we come to the biggest problem of all<br />
when it comes to new users and Linux:</p><br />
<p>They find out they're not wanted.</p><br />
<p>New users come to Linux after spending their lives using an OS<br />
where the end-user's needs are paramount, and <span style="font-style: italic;">"user friendly"</span><br />
and <span style="font-style: italic;">"customer focus"</span><br />
are considered veritable Holy Grails. And they<br />
suddenly find themselves using an OS that still relies on 'man' files,<br />
the<br />
command-line,&nbsp;hand-edited configuration files, and Google. And<br />
when they complain, they don't get coddled or promised better things:<br />
They get bluntly shown the door.</p><br />
<p>That's an exaggeration, of course.<br />
But it <span style="font-style: italic;">is</span><br />
<br />
how a lot of potential Linux converts perceived things when<br />
they tried and failed to make the switch.&nbsp;</p><br />
<p>In an odd way, FOSS is actually a very selfish development<br />
method:<br />
People only work on what they want to work on, when they want to work<br />
on it. Most people don't see any need to make Linux more attractive to<br />
inexperienced end-users: It already does what&nbsp;<span style="font-style: italic;">they</span> want it to do,<br />
why should they care if it doesn't work for other people?&nbsp;</p><br />
<p>FOSS has many parallels with the Internet itself: You don't<br />
pay the<br />
writer of <span style="font-weight: bold; color: rgb(51, 51, 255);">a<br />
webpage/the<br />
software</span> to download and <span style="font-weight: bold; color: rgb(51, 51, 255);">read/install</span><span style="color: rgb(51, 51, 255);"> it. </span><span style="font-weight: bold; color: rgb(51, 51, 255);">Ubiquitous<br />
broadband/User-friendly interfaces</span> are of no great<br />
interest to<br />
somebody who already &nbsp;<span style="font-weight: bold; color: rgb(51, 51, 255);">has<br />
broadband/knows how to use the software. Bloggers/developers</span><br />
<br />
don't need to have lots of <span style="font-weight: bold; color: rgb(51, 51, 255);">readers/users</span><br />
to justify <span style="font-weight: bold;"><span style="color: rgb(51, 51, 255);">blogging/coding</span>.</span><br />
There <span style="font-style: italic;">are</span><br />
lots of people making lots of money off it, but it's not by<br />
the old-fashioned <span style="font-style: italic;">"I<br />
own this&nbsp;and you have to pay me if you want some of it"</span><br />
method that most businesses are so enamoured of; it's by providing<br />
services like <span style="font-weight: bold; color: rgb(51, 51, 255);">tech-support/e-commerce</span><span style="color: rgb(51, 51, 255);">.</span>&nbsp;</p><br />
<br />
<p>Linux is not interested in market share. Linux does not have<br />
customers. Linux does not have shareholders, or a responsibility to the<br />
bottom line. Linux was not created to make money. Linux does not have<br />
the goal of being the most popular and widespread OS on the planet.</p><br />
<p>All the Linux community wants is to create a really good,<br />
fully-featured, free operating system. If that results in Linux<br />
becoming a hugely popular OS, then that's great. If that results in<br />
Linux having the most intuitive, user-friendly interface ever created,<br />
then that's great. If that results in Linux becoming the basis of a<br />
multi-billion dollar industry, then that's great.</p><br />
<p>It's <span style="font-weight: bold;">great</span>,<br />
but it's not <span style="font-weight: bold;">the<br />
point</span>. The point is to make Linux the best OS that the<br />
community is capable of making. Not for other people: For<br />
itself. The oh-so-common threats of&nbsp;<span style="font-style: italic;">"Linux will never take over the<br />
desktop unless it does such-and-such"</span> are simply<br />
irrelevant: The Linux community isn't <span style="font-style: italic;">trying</span> to take over<br />
the desktop. They really don't care if it gets good enough to make it<br />
onto&nbsp;<span style="font-style: italic;">your</span><br />
<br />
desktop, so long as it stays good enough to remain on&nbsp;<span style="font-style: italic;">theirs.</span> The<br />
highly-vocal MS-haters, pro-Linux zealots, and money-making FOSS<br />
purveyors might be loud, but they're still minorities.</p><br />
<p>That's what the Linux community wants: an OS that can be<br />
installed by whoever really wants it. So if you're<br />
considering switching to Linux, first ask yourself what <span style="font-weight: bold;">you</span> really want.</p><br />
<p>If you want an OS that doesn't chauffeur you around, but hands<br />
you the keys, puts you in the driver's seat, <span style="font-style: italic;">and expects you to know what to<br />
do</span>: Get Linux. You'll have to devote some time to learning<br />
how to use it, but once you've done so, you'll have an OS that you can<br />
make sit up and dance. </p><br />
<p>If you really just want Windows without the malware and<br />
security issues: Read up on good security practices; install a good<br />
firewall, malware-detector,&nbsp;and anti-virus; replace IE with a<br />
more secure browser; and keep yourself up-to-date with security<br />
updates. There are people out there <span style="font-style: italic;">(myself included)</span><br />
<br />
who've used Windows since 3.1 days right through to XP without ever<br />
being infected with a virus or malware: you can do it too. Don't get<br />
Linux: It will fail miserably at being what you want it to be.</p><br />
<p>If you really want the security and performance of a<br />
Unix-based OS but with a customer-focussed attitude and an<br />
world-renowned interface: Buy an Apple Mac. OS X is great. But don't<br />
get Linux: It will not do what you want it to do.</p><br />
<p>It's not just about <span style="font-style: italic;">"Why<br />
should I want Linux?"</span>. It's also about <span style="font-style: italic;">"Why should Linux want me?"</span></p><br />
</div><br />
</center></div>Nakedpig