 |
» |
|
|
 |
This section provides
procedures and troubleshooting information for Network File System
(NFS) and File Transfer Protocol (ftp). NFS allows a computer
access to a file system that resides on another computer’s
disks, as though the file system were mounted locally. The NFS server is
the computer to which the disk is physically attached; computers
that use the file system remotely are called NFS clients.
Before NFS clients can mount (import) a file
system that resides on the NFS server’s disks, the NFS
server must export it. Before you can import and export file systems, you must install
and configure NFS software on both the server and client systems.
In most cases this will have been done when the systems were installed. Use
the manual Installing and Administering NFS Services if
you need to install NFS. For information and guidelines on planning the workgroup’s file-sharing
configuration, see “Distributing Applications
and Data”. ftp is a mechanism for copying files from one system to another.
This section contains information on the following: See also: Exporting
a File System (HP-UX to HP-UX) |  |
Use either of the following
procedures to set up NFS exports on the server. Using SAM to Export a File SystemLog in to
the server as root. Run SAM: enter on the command line. Enable NFS if
necessary: Choose Networking and Communications/Network Services/NFS Server. Pull down the Actions menu and choose Enable. Choose Networking and Communications/Networked File Systems/Exported Local File Systems. Pull down the Actions menu and choose Add Exported File System Fill in the fields identifying the file systems to be
exported and the systems that can import them. Use SAM’s
online help if necessary.
The exported file system should now be listed in the /etc/exports file. Using the Command Line to Export a File SystemLog into
the server as root. If the system is not already configured as an NFS server: Edit /etc/rc.config.d/nfsconf, changing the values for NFS_SERVER and START_MOUNTD to
1. Run the nfs.server script: /sbin/init.d/nfs.server start |
Edit /etc/exports, adding an entry for each directory that is to be exported.
The entry identifies the directory and (optionally) the systems that
can import it. The entry should look something like this: /opt/netscape async,anon=65534,access=wsb2600:appserver:wsb2600:wszx6  |  |  |  |  | NOTE: If no systems are specified for
a particular file system, then all systems have
permission to import the file system; if any systems
are listed, then only those systems can import
the file system. |  |  |  |  |
See exports(4) for
more information. Force the NFS
daemon (nfsd) to re-read /etc/exports.
Importing
a File System (HP-UX to HP-UX) |  |
Before
you begin, you need to: Use either of the following procedures to import a file system.  |  |  |  |  | NOTE: SAM does not currently support AutoFS. For importing
using AutoFS, please see Chapter 2 in the manual Installing
and Administering NFS Services. |  |  |  |  |
Using SAM to Import a File SystemLog in to the client as
root. Run SAM. Enter: on the command line. Enable NFS client services if necessary: Choose “Networking and Communications/Network Services/NFS Client”,
then pull down the “Actions” menu and choose “Enable”. Choose “Networking and Communications/Networked
File Systems/Mounted Remote File Systems”, then pull down
the “Actions” menu and choose “Add Remote File
Systems.” Fill in the fields identifying the directories to be
imported. You can use ordinary NFS or the NFS Automounter. If you use the Automounter, the file
system will be mounted on the client only when a user or process
requests access to it, and will be unmounted after it has remained
untouched for five minutes. If you use the Automounter -hosts Map,
SAM will create a directory (/net by default) under which all the file systems (on any
host on the network) which this client is allowed to import, become
available on demand.
For more information, choose “Explain Automounter” under “Add Remote
File System ”in SAM, or see the automount(1M) manpage. Fill in the SAM fields identifying the directories to be imported.
Use SAM’s online help if you need to.  |  |  |  |  | NOTE: You do not have to call the directory on the client
by the same name it has on the server, but it will make things simpler
(more transparent) for your users if you do. If you are running
applications configured to use specific path names, you must make
sure those path names are the same on every system on which the
applications run. |  |  |  |  |
Using the Command Line to Import
a File SystemBefore you start: make sure the client
is configured to import file systems via NFS. The simplest method
is to use SAM; see Step 3 under “Using SAM to Import a File System”. Log in to the client as root. Create the local directory on the client if it does
not exist, for example:  |  |  |  |  | NOTE: If the directory does exist, its contents will be hidden
when you mount the remote directory, and will not be usable until
you unmount it. |  |  |  |  |
Add an
entry to /etc/fstab so the file system will be automatically mounted at
boot-up. nfs_server:/nfs_server_dir /client_dir nfs defaults 0 0 |
For example: fancy:/opt/adobe /opt/adobe nfs defaults 0 0 |
Mount the remote file system. The
following command forces the system to reread /etc/fstab and mount all the file systems:
Importing
HP-UX Directories to NT |  |
You can use either the HP
CIFS/9000 product or other third-party products to have access to
PC file systems. CIFS/9000 provides HP-UX with a distributed file system based
upon Microsoft’s CIFS (Common Internet File System) protocol,
also known as the SMB (Server Message Block) protocol. The SMB protocol
is the native file-sharing protocol in Microsoft Windows and OS/2
operating systems and is the standard way that millions of PC users
share files across corporate intranets. CIFS/9000 implements both the server and client components
of the CIFS protocol on HP-UX. This means that HP-UX file systems
can be mounted onto Window systems and Window file systems can be
mounted onto HP-UX systems. The CIFS/9000 Server is based upon Samba and provides file
as well as print services to CIFS clients including Windows NT,
XP, 2000 and other HP-UX machines running the CIFS/9000 Client software. The CIFS/9000 Client enables HP-UX users to mount as UNIX
file systems PC shares from CIFS files servers including Window
servers and HP-UX machines running the CIFS/9000 Server software.
The CIFS/9000 client also offers an optional Pluggable Authentication Module
(PAM) that implements the Windows NTLM authentication protocols.
When installed and configured within HP-UX’s PAM facility, this
allows HP-UX users to be authenticated against a Windows authentication
server. For information on CIFS/9000, including detailed usage on
HP-UX, see the manuals Installing and Administering the
CIFS/9000 Server and Installing and Administering the
CIFS/9000 Client, both available at http://docs.hp.com. Microsoft Windows NT does not include a native NFS function,
but several good third-party products make it easy to export HP-UX
file systems to an NT workstation. The quick reference that follows uses the DiskAccess product,
Microsoft Windows/NT Workstation 4.0, and HP-UX 10.x or later. It
assumes that you are using Domain Name Service (DNS) for network
routing.  |  |  |  |  | NOTE: A DiskAccess evaluation package is supplied with HP
Vectra XW Graphics workstations as of May 2, 1997. For other systems,
a free one-month evaluation package is available on the Web at http://www.ssc-corp.com/nfs. |  |  |  |  |
Install DiskAccess from CD onto the NT workstation and follow
prompts. Reboot the workstation when directed to do so. Exporting
a File System from an HP-UX ServerDo
the following on the HP-UX server. Configure the HP-UX system as an NFS
server; see “Exporting
a File System (HP-UX to HP-UX)”. Make
sure that the pcnfsd daemon is configured to start on boot in /etc/rc.config.d/nfsconf (PCNFS_SERVER should be set to 1). If necessary, edit /etc/rc.config.d/nfsconf changing the line to Make sure that pcnfsd is running: If pcnfsd is not running, start it: See pcnfsd(1M) for
more information Make sure that the directories to be exported are listed
in /etc/exports, and: either The NT client’s host name is listed among the systems
that have access to each directory or No systems are listed for the directories.
 |  |  |  |  | CAUTION: If you dial
in to the server using a variable IP address for the NT client, and
the server lists the client’s host name explicitly in /etc/exports, the lookup will fail because the IP address will not
match. You need to export the directory without restrictions (no
host names in /etc/exports). |  |  |  |  |
If you modified /etc/exports, force the system to re-read it: /usr/sbin/exportfs -a
Now do the following on the NT Client. Choose “Control
Panel--DiskAccess--Authentication”. Enter a user name and password valid on the
HP-UX server. Check the box for “PCNFSD Server” and enter
the host name of the HP-UX server. Click on “Filenames” in the “DiskAccess
Control Panel” and select “Preserve Case”.
Choose “Start--Programs--NT Explorer--Tools--Map
Network Drive” Enter the NT drive name or accept the default. Enter the HP-UX server’s hostname:/pathname, (or enter hostname only to see a list of the file systems
the server exports). Click on OK.
Troubleshooting
NFS |  |
Table 4-2 Title not available (Troubleshooting
NFS) | Problem | What To Do |
|---|
| Individual client can’t import from
one or more servers | Check the following on the
client: Verify
that the local directory exists on the client. If it does not exist,
create it using mkdir. For example:
LAN cable intact and connected, and all connections
are live. /etc/hosts exists and has “Requisite
Entries”. /etc/fstab exists and has “Requisite
Entries”, and the entries still point to valid directories on the
server. /etc/resolv.conf exists and has “Requisite
Entries” (DNS only) /etc/rc.config.d/nfsconf has NFS_CLIENT=1 Check the file directly, or check in SAM that NFS_CLIENT is enabled
(see “Using SAM to Import a File System”).
Check on
the servers that the directories the client is trying
to import exist and are listed in /etc/exports, and that the client has permission to import them.
See Step 3 under “Using the Command Line to Export a File System”. | All clients can’t import from
a given server | Do the following on
the server: Check
that the server is up and running, and that the LAN connection between
the server and clients is live (can you “ping” the clients from the server and vice versa?) Check that rpc.mountd is running: If rpc.mountd is not running (symptom RPC-PROG NOT REGISTERED), run it: Check that nfsd is running: ps -ef | grep nfsd If nfsd is not running, run it: Check that /etc/rc.config.d/nfsconf has NFS_SERVER=1 and START_MOUNTD=1,
or check in SAM that “NFS Server” is enabled (see “Using SAM to Export a File System”). Check that the file systems that the clients are
trying to mount are listed in /etc/exports. Check /etc/exports directly or check in SAM (see “Using SAM to Export a File System”).
| All clients can’t import from
a given server (cont’d) | On
the server (cont’d): (to force the server to re-read /etc/exports and export the file systems specified in it). Run SAM and get into the “Services Enable/Disable” menu under “Networking/Communications”,
click on “NFS Server” and choose “Restart” from
the pull-down menu. If these remedies fail, and the configuration looks
good (all the checks above), then the server may not have booted correctly;
try rebooting the server.
| Stale NFS file handle (Common on NFS clients after server
has crashed, or been rebooted before clients have unmounted NFS file
systems, or after /etc/exports has been changed on the server). | On the client(s): Check that there are no open files in the affected
file systems, then try unmounting and remounting them. Try this first if /etc/exports has been changed on the server (directly or via SAM).
On
the server: Try this first if server has just rebooted.
| | On an NFS server, umount fails. | Check that all
files are closed in the file system to be unmounted, and that it
is not anyone’s working directory, on the system (host)
from which it is to be unmounted. Note that although fuser(1M) can
be used to check for open files, it is not able to detect files
in a different directory opened within an editor. Try this if the directory is exported:
|
The following
entries are required in /etc/hosts, /etc/fstab, and /etc/resolv.conf: /etc/hosts: System host name and IP address, for
example: 12.0.14.123 fredsys fredsys.mysite.myco.com |
An entry similar to the following: 127.0.0.1 localhost loopback #[no SMTP] |
/etc/resolv.conf (needed for Domain Name Service [DNS] only): The name of the domain in which this
system resides, for example: At least one name server, for example:
Recovering Network Services after a Power
Failure |  |
This
section describes how to troubleshoot problems you and your workstation
users are likely to encounter when rebooting after a general power
failure or outage. The examples assume you are using DNS (Domain
Name Service). RPC_PROG_NOT_REGISTERED name_server rcmd: hostname: Unknown host rcmd: hostname: Not in database rcmd: hostname: Access denied A. When the Domain Name Server Goes Down If
a system powers up before the Domain Name Server
does, it will not find the name server and you will get the message: rcmd: hostname: Unknown host |
when the user tries to reach another system. The simplest solution is to reboot the system after the name
server has been rebooted. B. When a Client Can’t Import Directories
from a ServerDo
the troubleshooting checks described under “Troubleshooting
NFS”. If these fail, and the client is getting
messages such as: rcmd: hostname: Not in database |
rcmd: hostname: Access denied |
then do the following procedure on the server: Log in as superuser. Start SAM. Select “Networking and Communications/Network
Services/NFS Server”. Pull down the “Actions” menu and choose “Restart” or “Enable”. Select “NFS Client”. Pull down the “Actions” menu and choose “Restart” or “Enable”. Exit SAM. Execute /usr/sbin/exportfs -a.
Now do the following procedure on the client: Run SAM. Select “Networking and Communications--Network
Services--NFS Client”. Pull down the “Actions” menu and choose “Restart” or “Enable”.
Moving
or Reusing an Exported Directory |  |
If you rename an NFS-mounted
directory, NFS clients must unmount and remount the imported directory
before they can see the new contents. For example, if a server is exporting /opt/myapp, and you move /opt/myapp to /opt/myapp.old then rebuild and repopulate /opt/myapp, all the NFS clients must unmount
and remount the directory, for example (as superuser on each client): umount /opt/myapp mount -a |
Any client on which this is not done will continue to see
the former contents of /opt/myapp, that is /opt/myapp.old. You can encounter the same problem in a slightly different
way when you reuse an LVM volume. For example, suppose you unmount an obsolete file system named /projects from a file server named fp_server,
and subsequently reuse the logical volume, mounting a file system /newprojects on it. Any client that fails to unmount /projects will see the contents of fp_server:/newprojects, labeled /projects. Configuring
Anonymous ftp |  |
Anonymous ftp
allows users who do not have an account on a given system to send
files to, and retrieve them from, that system. Add user ftp to /etc/passwd, for example: ftp:*:500:1:anonymous ftp:/home/ftp:/usr/bin/false The password field should be *, the group
membership should be guest, or, as in this example, other,
and the login shell should be /usr/bin/false. In this example, user ftp’s user
ID is 500, and the anonymous ftp directory is /home/ftp. Create the anonymous ftp directory: Create the ftp home directory that you referred to in the /etc/passwd file, for example: mkdir /home/ftp Create the subdirectory /usr/bin under the ftp home directory, for example: cd /home/ftp mkdir usr cd usr mkdir bin
Copy the ls and pwd commands from /sbin and /usr/bin (respectively) to ~ftp/usr/bin, and set the permissions on the commands to executable
only (mode 0111): cp /sbin/ls /home/ftp/usr/bin cp /usr/bin/pwd /home/ftp/usr/bin chmod u=x,g=x,o=x /home/ftp/usr/bin/ls chmod u=x,g=x,o=x /home/ftp/usr/bin/pwd Set the owner of the ~ftp/usr/bin and ~ftp/usr directories to root, and set the permissions to not writable (mode 0555): chown root /home/ftp/usr/bin chmod u=rx,g=rx,o=rx /home/ftp/usr/bin chown root /home/ftp/usr chmod u=rx,g=rx,o=rx /home/ftp/usr Create the subdirectory etc under the ftp directory, for example: Copy /etc/passwd and /etc/group to ~ftp/etc. These files are required by the ls command, to display the owners of files and directories
under ~ftp. cp /etc/passwd /home/ftp/etc cp /etc/group /home/ftp/etc In all entries in /home/ftp/etc/passwd, replace the password field with an asterisk (*),
and delete the shell field, for example: ftp:*:500:1:anonymous ftp:/home/ftp: tom:*:8996:20::/home/tom: In all entries in /home/ftp/etc/group, replace the password field with an asterisk (*): users:*:20:acb guest:*:21:ftp Change the owner of the files in ~ftp/etc to root, and set the permissions to read only (mode 0444): chown root /home/ftp/etc chmod u=r,g=r,o=r /home/ftp/etc Create a directory pub under ~ftp, and change its owner to user ftp and its permissions to writable by all (mode 0777). Anonymous ftp users can put files in this directory to make
them available to other anonymous ftp users. mkdir /home/ftp/pub chown ftp /home/ftp/pub chmod u=rwx,g=rwx,o=rwx /home/ftp/pub Create a directory dist under ~ftp. Change its owner to root and its permissions to writable only by root (mode 0755). mkdir /home/ftp/dist chown root /home/ftp/dist chmod u=rwx,g=rx,o=rx /home/ftp/dist Change the owner of user ftp’s home directory to root and the permissions to not writable (mode 0555): chown root /home/ftp chmod u=rx,g=rx,o=rx /home/ftp
Troubleshooting
ftp login |  |
Symptom: Some
or all users can’t ftp to an HP-UX system.  |  |  |  |  | NOTE: If no users
can ftp to a given system, check first of all that inetd is running on that system: ps -ef | grep inetd If inetd is not running, start it: /usr/sbin/inetd It is also possible
that the ftp service is disabled. Check /etc/inetd.conf for the following line: ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l If this line does not exist, or is commented out (preceded
by a pound sign, (#) add it (or remove the pound sign) and restart inetd: /usr/sbin/inetd -c You can
also use SAM to check for the status of ftp and enable it if necessary: go to Networking and Communications/Network Services. |  |  |  |  |
Problem: ftp calls getusershell which by default checks password information (that is,
the entry in /etc/passwd for the user who is trying to log in) against a fixed
list. If the shell isn’t on the list, ftp won’t let the user in, so if you use an unusual
shell you may not be able to ftp even to your own system. getusershell can be made aware of other shells via /etc/shells; see “Fix 2”. Fix 1Convert all /bin/shell to /usr/bin/shell in /etc/passwd. Fix 2Create /etc/shells on the system that is rejecting ftp logins and list all the shells that appear in /etc/passwd. For more information see: getusershell(3C), shells(4).
|