Add <username> tags for root and fix some minor issues.

Approved by:    simon(mentor)
Submitted by:   Lukas Ertl <l.ertl@univie.ac.at>
PR:             docs/54789
This commit is contained in:
Josef El-Rayes 2004-01-17 19:01:46 +00:00
parent 77c25b096c
commit 4af34cdb02
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=19701

View file

@ -43,8 +43,8 @@
<para>Congratulations on installing FreeBSD! This introduction
is for people new to both FreeBSD <emphasis>and</emphasis>
&unix;&mdash;so it starts with basics. It assumes you are using
version 2.0.5 or later of FreeBSD as distributed by BSDi
or FreeBSD.org, your system (for now) has a single user
version 2.0.5 or later of &os; as distributed by
&os;.org, your system (for now) has a single user
(you)&mdash;and you are probably pretty good with DOS/&windows;
or &os2;.</para>
</abstract>
@ -54,13 +54,13 @@
<title>Logging in and Getting Out</title>
<para>Log in (when you see <prompt >login:</prompt>) as a user you
created during installation or as <firstterm>root</firstterm>.
created during installation or as <username>root</username>.
(Your FreeBSD installation will already have an account for
root; root can go anywhere and do anything, including deleting
<username>root</username>; who can go anywhere and do anything, including deleting
essential files, so be careful!) The symbols &prompt.user; and
&prompt.root; in the following stand for the prompt (yours may
be different), with &prompt.user; indicating an ordinary user
and &prompt.root; indicating root.</para>
and &prompt.root; indicating <username>root</username>.</para>
<para>To log out (and get a new <prompt >login:</prompt> prompt)
type</para>
@ -104,14 +104,14 @@
<title>Adding A User with Root Privileges</title>
<para>If you did not create any users when you installed the system
and are thus logged in as root, you should probably create a
and are thus logged in as <username>root</username>, you should probably create a
user now with</para>
<informalexample>
<screen>&prompt.root; <userinput>adduser</userinput></screen>
</informalexample>
<para>The first time you use adduser, it might ask for some
<para>The first time you use <command>adduser</command>, it might ask for some
defaults to save. You might want to make the default shell
&man.csh.1; instead of &man.sh.1;, if it suggests
<command>sh</command> as the default. Otherwise just press
@ -119,10 +119,10 @@
<filename>/etc/adduser.conf</filename>, an editable file.</para>
<para>Suppose you create a user <username>jack</username> with
full name <emphasis>Jack Benimble</emphasis>. Give jack a
full name <emphasis>Jack Benimble</emphasis>. Give <username>jack</username> a
password if security (even kids around who might pound on the
keyboard) is an issue. When it asks you if you want to invite
jack into other groups, type <groupname>wheel</groupname></para>
<username>jack</username> into other groups, type <groupname>wheel</groupname></para>
<informalexample>
<screen>Login group is ``jack''. Invite jack into other groups: <userinput>wheel</userinput></screen>
@ -130,14 +130,14 @@
<para>This will make it possible to log in as
<username>jack</username> and use the &man.su.1;
command to become root. Then you will not get scolded any more for
logging in as root.</para>
command to become <username>root</username>. Then you will not get scolded any more for
logging in as <username>root</username>.</para>
<para>You can quit <command>adduser</command> any time by typing
<keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>,
and at the end you will have a chance to approve your new user or
simply type <keycap>n</keycap> for no. You might want to create
a second new user (jill?) so that when you edit jack's login
a second new user so that when you edit <username>jack</username>'s login
files, you will have a hot spare in case something goes
wrong.</para>
@ -145,11 +145,11 @@
back to a login prompt and log in as <username>jack</username>.
In general, it is a good idea to do as much work as possible as
an ordinary user who does not have the power&mdash;and
risk&mdash;of root.</para>
risk&mdash;of <username>root</username>.</para>
<para>If you already created a user and you want the user to be
able to <command>su</command> to root, you can log in as root
and edit the file <filename>/etc/group</filename>, adding jack
able to <command>su</command> to <username>root</username>, you can log in as <username>root</username>
and edit the file <filename>/etc/group</filename>, adding <username>jack</username>
to the first line (the group <groupname>wheel</groupname>). But
first you need to practice &man.vi.1;, the text editor&mdash;or
use the simpler text editor, &man.ee.1;, installed on recent
@ -219,7 +219,7 @@
<listitem>
<para>Lists hidden <quote>dot</quote> files with the others.
If you are root, the <quote>dot</quote> files show up
If you are <username>root</username>, the <quote>dot</quote> files show up
without the <option>-a</option> switch.</para>
</listitem>
</varlistentry>
@ -384,7 +384,7 @@
on a database that is rebuilt weekly. If your machine is not
going to be left on over the weekend (and running FreeBSD), you
might want to run the commands for daily, weekly, and monthly
maintenance now and then. Run them as root and give each one
maintenance now and then. Run them as <username>root</username> and give each one
time to finish before you start the next one, for now.</para>
<informalexample>
@ -410,7 +410,7 @@
<para>Running such commands is part of system
administration&mdash;and as a single user of a &unix; system,
you are your own system administrator. Virtually everything you
need to be root to do is system administration. Such
need to be <username>root</username> to do is system administration. Such
responsibilities are not covered very well even in those big fat
books on &unix;, which seem to devote a lot of space to pulling
down menus in windows managers. You might want to get one of
@ -428,14 +428,12 @@
<para>To configure your system, you need to edit text files. Most
of them will be in the <filename>/etc</filename> directory; and
you will need to <command>su</command> to root to be able to
you will need to <command>su</command> to <username>root</username> to be able to
change them. You can use the easy <command>ee</command>, but in
the long run the text editor <command>vi</command> is worth
learning. There is an excellent tutorial on vi in
<filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you
have that installed; otherwise you can get it by FTP to
<hostid>ftp.cdrom.com</hostid> in the directory
FreeBSD/FreeBSD-current/src/contrib/nvi/docs/tutorial.</para>
<filename>/usr/src/contrib/nvi/docs/tutorial</filename>, if you
have the system sources installed.</para>
<para>Before you edit a file, you should probably back it up.
Suppose you want to edit <filename>/etc/rc.conf</filename>. You
@ -609,9 +607,9 @@
<command>:w</command>) when you need to.</para>
<para>Now you can <command>cd</command> to
<filename>/etc</filename>, <command>su</command> to root, use
<filename>/etc</filename>, <command>su</command> to <username>root</username>, use
<command>vi</command> to edit the file
<filename>/etc/group</filename>, and add a user to wheel so the
<filename>/etc/group</filename>, and add a user to <groupname>wheel</groupname> so the
user has root privileges. Just add a comma and the user's login
name to the end of the first line in the file, press
<keycap>Esc</keycap>, and use <command>:wq</command> to write
@ -636,7 +634,7 @@
<para>will remove formatting codes and send the manual page to the
<filename>chmod.txt</filename> file instead of showing it on
your screen. Now put a dos-formatted diskette in your floppy
drive a, <command>su</command> to root, and type</para>
drive <devicename>a</devicename>, <command>su</command> to <username>root</username>, and type</para>
<informalexample>
<screen>&prompt.root; <userinput>/sbin/mount -t msdos /dev/fd0 /mnt</userinput></screen>
@ -645,7 +643,7 @@
<para>to mount the floppy drive on
<filename>/mnt</filename>.</para>
<para>Now (you no longer need to be root, and you can type
<para>Now (you no longer need to be <username>root</username>, and you can type
<command>exit</command> to get back to being user jack) you can
go to the directory where you created
<filename>chmod.txt</filename> and copy the file to the floppy
@ -674,7 +672,7 @@
what do I do?</quote>&mdash;people will want to know what
<command>dmesg</command> has to say.</para>
<para>You can now dismount the floppy drive (as root) to get the
<para>You can now dismount the floppy drive (as <username>root</username>) to get the
disk out with</para>
<informalexample>
@ -696,7 +694,7 @@
<filename>/var/spool/output</filename>. If your printer is on
<hardware>lpt0</hardware> (what DOS calls
<hardware>LPT1</hardware>), you may only need to go to
<filename>/var/spool/output</filename> and (as root) create the
<filename>/var/spool/output</filename> and (as <username>root</username>) create the
directory <filename>lpd</filename> by typing: <command>mkdir
lpd</command>, if it does not already exist. Then the printer
should respond if it is turned on when the system is booted, and
@ -762,7 +760,7 @@
<term><command>passwd</command></term>
<listitem>
<para>to change user's password (or root's password)</para>
<para>to change user's password (or <username>root</username>'s password)</para>
</listitem>
</varlistentry>
@ -794,9 +792,7 @@
<para>An excellent book that explains &unix; commands and utilities
is Abrahams &amp; Larson, <citetitle>Unix for the
Impatient</citetitle> (2nd ed., Addison-Wesley, 1996).
There is also a lot of &unix; information on the Internet. Try the
<ulink URL="http://www.geek-girl.com/unix.html">Unix Reference
Desk</ulink>.</para>
There is also a lot of &unix; information on the Internet.
</sect1>
<sect1>
@ -967,7 +963,7 @@ setenv XNLSPATH /usr/X11R6/lib/X11/nls</programlisting>
</step>
<step>
<para>As root, edit <filename>/etc/shells</filename>, adding a
<para>As <username>root</username>, edit <filename>/etc/shells</filename>, adding a
line in the file for the new shell, in this case
<filename>/usr/local/bin/tcsh</filename>, and save the file.
(Some ports may do this for you.)</para>
@ -982,13 +978,13 @@ setenv XNLSPATH /usr/X11R6/lib/X11/nls</programlisting>
</procedure>
<note>
<para>It can be dangerous to change root's shell to something
<para>It can be dangerous to change <username>root</username>'s shell to something
other than <command>sh</command> or <command>csh</command> on
early versions of FreeBSD and many other versions of &unix;; you
may not have a working shell when the system puts you into
single user mode. The solution is to use <command>su
-m</command> to become root, which will give you the
<command>tcsh</command> as root, because the shell is part of
-m</command> to become <username>root</username>, which will give you the
<command>tcsh</command> as <username>root</username>, because the shell is part of
the environment. You can make this permanent by adding it to
your <filename>.tcshrc</filename> file as an alias with:</para>
<programlisting>alias su su -m</programlisting>
@ -1010,7 +1006,7 @@ setenv XNLSPATH /usr/X11R6/lib/X11/nls</programlisting>
<filename>.tcshrc</filename> that will tell you how many
commands you have typed, what time it is, and what directory you
are in. It also produces a <literal>></literal> if you are an
ordinary user and a <literal>#</literal> if you are root, but
ordinary user and a <literal>#</literal> if you are <username>root</username>, but
tsch will do that in any case:</para>
<para>set prompt = "%h %t %~ %# "</para>
@ -1034,7 +1030,7 @@ setenv XNLSPATH /usr/X11R6/lib/X11/nls</programlisting>
<sect1>
<title>Other</title>
<para>As root, you can dismount the CDROM with
<para>As <username>root</username>, you can dismount the CDROM with
<command>/sbin/umount /cdrom</command>, take it out of the
drive, insert another one, and mount it with
<command>/sbin/mount_cd9660 /dev/cd0a /cdrom</command> assuming