svn commit: r41667 - in projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook: basics users

Tom Rhodes trhodes at FreeBSD.org
Sun May 19 00:01:58 UTC 2013


Author: trhodes
Date: Sun May 19 00:01:57 2013
New Revision: 41667
URL: http://svnweb.freebsd.org/changeset/doc/41667

Log:
  Add more information on binary formats in basics.
  Add a note about sudo in the users chapter.
  Add a section on using root in the users chapter.

Modified:
  projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/basics/chapter.xml
  projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/users/chapter.xml

Modified: projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/basics/chapter.xml
==============================================================================
--- projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/basics/chapter.xml	Sat May 18 23:44:23 2013	(r41666)
+++ projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/basics/chapter.xml	Sun May 19 00:01:57 2013	(r41667)
@@ -302,6 +302,15 @@ console none                            
       managing requests for hardware devices, peripherals, memory, and
       CPU time fairly to each user.</para>
 
+    <para>Much more information about User Accounts is in the chapter
+      about <link linkend="users">accounts</link>.  For now you just
+      need to know that each person (user) who uses the computer should be
+      given their own username and password.  The system keeps track
+      of the people using the computer based on this username.  Since
+      it is often the case that several people are working on the same
+      project Unix also provides groups.  Several users can be placed
+      in the same group.</para>
+
     <para>Because the system is capable of supporting multiple users,
       everything the system manages has a set of permissions governing
       who can read, write, and execute the resource.  These
@@ -2416,8 +2425,23 @@ Swap: 256M Total, 38M Used, 217M Free, 1
   <sect1 id="binary-formats">
     <title>Binary Formats</title>
 
-    <para>To understand why &os; uses the &man.elf.5; format,the three
-      currently <quote>dominant</quote> executable formats for &unix;
+    <para>Typically when a command is passed to the shell, the shell
+      will arrange for an executable file to be loaded into memory and
+      a new process is created.  Executable files can either be a binary
+      file (usually created by the linker as part of compiling a program)
+      or a shell script (text file to be interpreted by a binary file,
+      like &man.sh.1; or &man.perl.1;).  The &man.file.1; command can
+      usually determine what is inside a file.</para>
+
+    <para>Binary files need to have a well defined format for the system
+      to be able to use them properly.  Part of the file will be the
+      executable machine code (the instructions that tell the CPU what
+      to do), part of it will be data space with pre-defined values,
+      part will be data space with no pre-defined values, etc.  Through
+      time, different binary file formats have evolved.</para>
+
+    <para>To understand why &os; uses the &man.elf.5; format, the three
+      currently <quote>dominant</quote>, executable formats for &unix;
       must be described:</para>
 
     <itemizedlist>
@@ -2545,6 +2569,14 @@ Swap: 256M Total, 38M Used, 217M Free, 1
       out of the <filename>GENERIC</filename> kernel, and eventually
       removed from the kernel once the need to run legacy
       <filename>a.out</filename> programs is past.</para>
+
+    <para>In addition to &man.file.1; another command that can prove
+      useful when working with executables is &man.ldd.1;.  If
+      &man.file.1; reveals that a file is a dynamically linked
+      executable &man.ldd.1; can figure out what dynamically linked
+      libraries that executable file requires.  Sometimes programs can
+      be linked against compatibility libraries instead of the main
+      system libraries, or otherwise rely on dynamic libraries.</para>
   </sect1>
 
   <sect1 id="basics-more-information">

Modified: projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/users/chapter.xml
==============================================================================
--- projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/users/chapter.xml	Sat May 18 23:44:23 2013	(r41666)
+++ projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/users/chapter.xml	Sun May 19 00:01:57 2013	(r41667)
@@ -1034,4 +1034,49 @@ uid=1001(jru) gid=1001(jru) groups=1001(
       <filename>/etc/group</filename>, refer to &man.pw.8; and
       &man.group.5;.</para>
   </sect1>
+
+  <sect1 id="users-becomesuper">
+    <title>Becoming Superuser</title>
+
+    <para>There are several ways to do things as the superuser.  The
+      worst way is to log in as <username>root</username> directly.
+      Usually very little activity requires <username>root</username>
+      so logging off and logging in as <username>root</username>,
+      performing tasks, then logging off and on again as a normal user
+      is a waste of time.</para>
+
+    <para>A better way is to use &man.su.1; without providing a login
+      but using <literal>-</literal> to inherit the root environment.
+      Not providing a login will imply super user.  For this to work
+      the login that must be in the <groupname>wheel</groupname> group.
+      An example of a typical software installation would involve the
+      administrator unpacking the software as a normal user and then
+      elevating their privileges for the build and installation of
+      the software.</para>
+
+    <example>
+      <title>Install a Program As The Superuser</title>
+
+      <screen>&prompt.user; <userinput>configure</userinput>
+&prompt.user; <userinput>make</userinput>
+&prompt.user; <userinput>su -</userinput>
+Password:
+&prompt.root; <userinput>make install</userinput>
+&prompt.root; <userinput>exit</userinput>
+&prompt.user;</screen>
+    </example>
+
+    <para>Note in this example the transition to
+      <username>root</username> is less painful than logging off
+      and back on twice.</para>
+
+    <para>Using &man.su.1; works well for single systems or small
+      networks with just one system administrator.  For more complex
+      environments (or even for these simple environments)
+      <command>sudo</command> should be used.  It is provided as a port,
+      <filename role="package">security/sudo</filename>.  It allows for
+      things like activity logging, granting users the ability to only
+      run only certain commands as the superuser, and several other
+      options.</para>
+  </sect1>
 </chapter>


More information about the svn-doc-projects mailing list