type 对于虚拟终端,对应的类型为cons25。其它通常的值包括伪终端network,调制解调器入口dialup,以及unknown,用于用户试图以无法预定的类型进行连接的终端。
status 它必须是on或off。如果是on,init将运行getty栏指定的程序。如果出现单词“secure”,说明该tty允许root登录;为避免这种情况,可以用单词“insecure”。
让我们从虚拟终端部分开始解释该文件;可以看到它是以设置控制台开始的:
# If console is marked "insecure", then init will ask # for the root passWord when going to single-user mode. console none unknown off secure 如果在引导过程中fsck命令运行出了问题,init将使你的FreeBSD系统进入单用户模式以使root用户可以修复问题。如果你用insecure代替secure来设置控制台,init将在你可以继续干之前索取口令。
ttyv0 "/usr/libexec/getty Pc" cons25 on secure # Virtual terminals ttyv1 "/usr/libexec/getty Pc" cons25 on secure ttyv2 "/usr/libexec/getty Pc" cons25 on secure ttyv3 "/usr/libexec/getty Pc" cons25 on secure ttyv4 "/usr/libexec/getty Pc" cons25 on secure ttyv5 "/usr/libexec/getty Pc" cons25 on secure ttyv6 "/usr/libexec/getty Pc" cons25 on secure ttyv7 "/usr/libexec/getty Pc" cons25 on secure ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure 你可以看到在我的FreeBSD系统上除了控制台以外还有八个虚拟终端;我可以通过按ALT键加一个控制键来访问每个终端。例如ALT F1可访问控制台,ALT F2访问ttyv1, ALT F3访问ttyv2,等等。如果我启动了X会话,那么它可以用ALT F8来访问。如果我把ttyv8上的单词off改为on,那么我可以在引导时得到一个X终端而不是控制台。然后可以继续用我ALT加功能键来访问其它终端。我的所有这些虚拟终端都标为 “secure”,说明它们都可接受root登录。你可以有多少个虚拟终端是由你的FreeBSD版本所决定的;如果你希望建立更多虚拟终端,可以读一下这个faq。
现在让我们移到拨号终端:
# Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. ttyd0 "/usr/libexec/getty std.9600" dialup off secure ttyd1 "/usr/libexec/getty std.9600" dialup off secure ttyd2 "/usr/libexec/getty std.9600" dialup off secure ttyd3 "/usr/libexec/getty std.9600" dialup off secure