Using HP-UX Internet Services HP-UX 11i v2 Edition 1 Manufacturing Part Number: B2355-90827 August 2003 U.S.A. © Copyright 2003 Hewlett-Packard Development Company L.P. All Rights Reserved.
Legal Notices The information in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be held liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material.
© Copyright 1989-93 The Open Software Foundation, Inc. © Copyright 1986 Digital Equipment Corporation. © Copyright 1990 Motorola, Inc. © Copyright 1990, 1991, 1992 Cornell University © Copyright 1989-1991 The University of Maryland © Copyright 1988 Carnegie Mellon University Trademark Notices MS-DOS and Microsoft are U.S. registered trademarks of Microsoft Corporation. UNIX is a registered trademark in the United States and other countries, licensed exclusively through The Open Group.
Contents About This Document 1. Logging into a Host Using telnet Checking Your Local Terminal Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Normal Procedure to Invoke telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quicker Method to Invoke telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Variable Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File Distribution Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command to List Changed Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting rdist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About This Document This manual describes how to use the HP-UX Internet Services products. It assumes that the HP-UX 11i v2 operating system software and the appropriate files, scripts, and subsets are installed on your system. Intended Audience This manual is intended for end users who have experience working on HP-UX and have access to the HP-UX manpages.
Publishing History Table 2 provides, for a particular document, the manufacturing part number, the respective operating systems, and the publication date. Table 2 Publishing History Details Document Manufacturing Part Number Operating System Supported Publication Date B2355-90111 10.x June 1996 B2355-90148 11.0 October 1997 B2355-90743 11.11 11.20 11.
Table 3 Document Organization (Continued) Chapter Description Transferring Files with ftp Provides information about copying files over a network connection between the local client host and a remote host, using the FTP protocol. It also describes how to set up an automatic remote login for ftp. Transferring Files with rcp Describes how to transfer files between HP-UX or UNIX hosts. Executing Commands with remsh Describes how to execute commands on a remote host using the remsh command.
Provides an overview of the routing daemons, gated and mrouted, supported in the HP-UX 11i v2 operating system. It also explains the various protocols that these routing daemons support.You can access this manual at the following URL: http://www.docs.hp.com/hpux/netcom/index.
http://www.ora.com • iknow Topics of Interest HP iknow Topics of Interest describe some networking concepts and tasks, as well as other topics. You can find these documents on the HP-UX networking communications home page at the following URL: http://docs.hp.com/iknow Typographical Conventions This document uses the following typographic conventions: audit (5) An HP-UX manpage. In this example, audit is the name and 5 is the section in the HP-UX Reference.
HP Encourages Your Feedback HP welcomes any comments and suggestions you have on this manual. You can send your comments in the following ways: • Internet electronic mail: netinfo_feedback@cup.hp.com • Using a feedback form located at the following URL: http://docs.hp.com/assistance/feedback.html Please include the following information along with your comments: 12 • The full title of the manual and the part number. (The part number appears on the title page of printed and PDF versions of a manual.
1 Logging into a Host Using telnet telnet is used to log into a remote HP-UX, UNIX, or non-UNIX host that supports the ARPA services. It allows you to enter and execute commands on the remote host similar to executing commands on the remote host’s console.
Logging into a Host Using telnet This chapter contains information about how to log into a host using the telnet program. It discusses the following topics: • “Checking Your Local Terminal Configuration” on page 15 • “Using telnet” on page 16 • “Quicker Method to Invoke telnet” on page 17 • “Checking Your Remote Terminal Configuration” on page 18 • “Changing the Behavior of Carriage Returns” on page 19 • “Obtaining Help” on page 20 For more information, type man 1 telnet at the HP-UX prompt.
Logging into a Host Using telnet Checking Your Local Terminal Configuration Checking Your Local Terminal Configuration Before you log into a remote host using the telnet or rlogin program, ensure that your local terminal configuration settings are correct for the type of remote communication you intend to perform. The following factors determine if you need to change your local terminal configuration settings: • Type of remote host you intend to log into.
Logging into a Host Using telnet Using telnet Using telnet This sections describes the following methods to use the telnet: • Normal Procedure to Invoke telnet • Quicker Method to Invoke telnet Normal Procedure to Invoke telnet The following steps describe how to use the telnet program: 1. Type telnet at the HP-UX prompt, as follows to start telnet in the command mode: telnet In the command mode, telnet displays the telnet> prompt. From the command mode, you can execute telnet commands.
Logging into a Host Using telnet Using telnet 4. When you have finished working on the remote host, type the telnet escape character to return to command state. The escape character is CTRL-] if you have not changed it with the telnet escape command. 5. At the telnet> prompt, type the following command to disconnect from the remote host: close hostname Following is an example to disconnect from the remote host hpabsa: telnet> close hpabsa 6.
Logging into a Host Using telnet Checking Your Remote Terminal Configuration Checking Your Remote Terminal Configuration After you have connected to the remote host, if you are using an HP terminal or an HP terminal emulator (such as a terminal window in HP VUE), follow this procedure to check your terminal settings on the remote host. 1. Issue the following command at the remote host’s command prompt to ensure that your terminal type is set to hp: echo $TERM 2.
Logging into a Host Using telnet Changing the Behavior of Carriage Returns Changing the Behavior of Carriage Returns You may sometimes notice a change in the way your local host interprets a carriage return received from a remote host. This indicates that the telnet’s carriage return mode setting is wrong for the type of remote host to which you are connected. In such cases, your local host must change the carriage return setting appropriately.
Logging into a Host Using telnet Obtaining Help Obtaining Help You can obtain information about the telnet commands by typing ? at the telnet> prompt. You can either list the commands or obtain information about a specific command. Listing the telnet Commands To list the telnet commands, perform the following steps: 1. If you are not at the telnet> prompt, enter the telnet escape character (usually CTRL-]) to display the prompt. 2.
Logging into a Host Using telnet Obtaining Help NOTE Chapter 1 If you were connected to a remote host and wish to redisplay its prompt, press Return twice.
Logging into a Host Using telnet Obtaining Help 22 Chapter 1
2 Logging into a Host with rlogin rlogin is used to log into a remote HP-UX or UNIX host from your local host. It allows you to work on the remote host similar to executing commands on the remote host’s console. For more information, type man 1 rlogin at the HP-UX prompt.
Logging into a Host with rlogin Using rlogin Using rlogin If you have an account on a remote host, you can use rlogin to log into the remote host. The following steps describe how to log into a remote host: 1. Before you log into a remote host with rlogin, ensure that your local terminal configuration settings are correct for the type of remote communication you intend to perform. See “Checking Your Local Terminal Configuration” on page 15, for more information. 2.
Logging into a Host with rlogin Using rlogin Creating a $HOME/.rhosts File on a Remote Host If you have an account on a remote host, you can set up the account so that you can log into the remote host without specifying your remote login name and password. To create a $HOME/.rhosts file on the remote host, perform the following steps: 1. If you do not know where your home directory is on the remote host, log into the remote host and issue the following command: echo $HOME 2. Create a file called .
Logging into a Host with rlogin Using rlogin 26 Chapter 2
3 Transferring Files with ftp With ftp, you can transfer files among HP-UX, UNIX, and non-UNIX network hosts that support ARPA services. For more information, type man 1 ftp at the HP-UX prompt.
Transferring Files with ftp Using ftp Using ftp The following steps describe how to transfer files between the local and remote host using the ftp program: 1. Issue the following command to establish a connection with the remote host: ftp remote_host_name or ftp remote_IP_address 2. Type your user name when prompted for by the remote host. If you do not have an account on the remote host, type anonymous or ftp as the user name to get access to the anonymous ftp directory.
Transferring Files with ftp Using ftp ftp> put filename [destination_filename] ftp> get filename [destination_filename] The put command transfers a file from the local host to the remote host. The get command transfers a file from the remote host to the local host. If you do not specify a destination_filename, the file is copied with the original name. 7. To exit from ftp and return to the HP-UX prompt on your local host, type quit at the ftp> prompt.
Transferring Files with ftp Setting Up Automatic Remote Login for ftp Setting Up Automatic Remote Login for ftp If you have an account on a remote host, you can create a .netrc file in your local home directory that allows you to log into the remote host without supplying your remote login name and password. The .netrc file can be used for programs that need to perform ftp operations unattended. The following steps describe how to create the .netrc file on the local host: 1. Create a file called .
4 Transferring Files with rcp The rcp command allows you to copy files between HP-UX or UNIX hosts. You can also copy the contents of an entire directory, including the contents of all its subdirectories, using the rcp command. From your local host, you can also copy files between two remote hosts.
Transferring Files with rcp Enabling rcp Enabling rcp Before you can use rcp to copy files to or from a remote host, the remote host must be configured in one of the following methods: • You must have an account on the remote host with the same login name as your local login name and the name of your local host must be in the remote host’s /etc/hosts.equiv file. • You must have an account on the remote host, and the name of your local host and your local login name must be in a .
Transferring Files with rcp Using rcp Using rcp You can use rcp to copy one or more files or directories from the local host to a remote host, as in the following example: rcp /tmp/memo1 /tmp/memo2 basil:/home/roger This example copies the files /tmp/memo1 and /tmp/memo2 from the local host to the user Roger’s home directory on the host basil. The last path specified on the command line is considered as the destination path.
Transferring Files with rcp Using rcp 34 Chapter 4
5 Distributing Files Using rdist This chapter contains information about how to use rdist, a program that distributes and maintains identical copies of files across multiple network hosts. You can use rdist to install new or updated software on all the machines in a network.
Distributing Files Using rdist sections: 36 • “Overview” on page 37 • “Setting Up remsh” on page 39 • “Creating the distfile” on page 42 • “Starting rdist” on page 50 • “Troubleshooting rdist” on page 53 Chapter 5
Distributing Files Using rdist Overview Overview rdist facilitates maintaining of identical copies of files over multiple hosts. It preserves the owner, group, mode and modification time of the file and can also update programs that are executing. To use rdist, you must designate one system in the network as the master host. The master host contains the master copy of the source files that are distributed to remote hosts. The rdist software is installed as part of the operating system.
Distributing Files Using rdist Overview Figure 5-1 shows the distribution of source files filea1, filea2, and filea3 from the master host A to the remote hosts B and C. Figure 5-1 Distributing Files with rdist Standard Output: updating host B installing: filea1 installing: filea2 installing: filea3 updating host C ... System A (Master Host) rdist Source Files: filea1 filea2 filea3 System B System C rdist rdist The rdist process does not prompt for passwords.
Distributing Files Using rdist Setting Up remsh Setting Up remsh rdist uses remsh as the mechanism for distributing files over the network. In order to use rdist, you must set up remsh on all the remote hosts. To set up remsh, perform the following steps on each of the remote hosts: 1. Create an entry for the master host in the $HOME/.rhosts file of the user who runs rdist. For example, if rdist is run by the root user, create an entry for the master host in the root’s .rhosts file (/.
Distributing Files Using rdist Setting Up remsh PAM Configuration File The /etc/pam.conf file is the configuration file for the PAM architecture. The /etc/pam.conf file contains a list of services and each service is paired with a corresponding service module. When a service is requested, its associated module is invoked. Each entry in the /etc/pam.conf file has the following format: Service_name module_type control_flag module_path options. where, service_name This option refers to a service.
Distributing Files Using rdist Setting Up remsh In this example, dtlogin and the keyword, OTHER, indicate the service name. The service name OTHER specifies the module for all those applications that are not specified in the configuration file. Enabling Standard UNIX Authentication on rexecd and remshd Services To use the rexec and remsh services enabled with PAM, add the following entries to the /etc/pam.conf file: rcomds rcomds auth required /usr/lib/security/libpam_unix.
Distributing Files Using rdist Creating the distfile Creating the distfile The distfile used by the master host contains a sequence of entries that specify the files to be copied, the destination hosts, and the operations to be performed for updating the host. The distfile is an ASCII file, therefore you can create the distfile, which is an ASCII file, using any text editor. The structure of a distfile is similar to the make program.
Distributing Files Using rdist Creating the distfile variable_name Specifies the name used to reference the variable. name_list Contains item names separated by a space and enclosed within parentheses. Spaces or tabs on either side of the equals (=) sign are ignored. Subsequent appearances of the ${variable_name} in the distfile (except in comments) are replaced by name_list. (You can omit braces if the variable_name consists of just one character.
Distributing Files Using rdist Creating the distfile File Distribution Commands The distfile command entries that distribute files to a remote host are specified in the following format: [label:] source_list -> destination_list command_list ; where, Command Entry 44 Description label: Groups the command entries and is an optional distfile command entry. You can use labels to perform a partial update. Normally, rdist updates all the files and directories listed in a distfile.
Distributing Files Using rdist Creating the distfile Command Entry command_list Chapter 5 Description Specifies a list of commands to be performed. Table 5-1 contains the different commands that can be used in the command_list. Each command must end with a semicolon (;).
Distributing Files Using rdist Creating the distfile Table 5-1 The distfile Commands Command Name install 46 Description Copies source files or directories to each host in the destination list. You can specify any of the following options: -b Performs a binary comparison of the file and updates them if they differ. Without this option, rdist updates files only if the size or modification time differs. -h Allows symbolic links on the master host and copies the files that the link points to.
Distributing Files Using rdist Creating the distfile Table 5-1 The distfile Commands (Continued) Command Name Description notify user[@host] Sends a list of updated files and errors occurred to a specified receiver. If you do not specify host, the remote host name is the default value. except file_list Updates all files in the source list except the files specified in file_list. except_pat pattern Updates all files in the source list except the file names that contain the pattern pattern.
Distributing Files Using rdist Creating the distfile • ${FILES} -> ${HOSTS} install -R ; except /usr/lib/${EXLIB} ; except /usr/games/lib ; This command distributes the source files defined in the variable FILES to the destination hosts defined in the variable HOSTS. rdist copies the files to each remote host, removing files in the remote host’s directory that do not exist on the master directory. rdist does not update files in /usr/lib/${EXLIB} or in /usr/games/lib.
Distributing Files Using rdist Creating the distfile ${FILES} :: stamp.cory notify root@cory ; In this example, the list of files that are newer than the timestamp in stamp.cory are mailed to the user root@cory. With the notify command, if an @ symbol appears in the user name, the default value is the remote host name.
Distributing Files Using rdist Starting rdist Starting rdist After creating the distfile on the master host, you can start rdist from the command line or from a cron file. You must run rdist as root on the master host. Following are the syntaxes for starting rdist from the command line: • /usr/bin/rdist [-b] [-h] [-i] [-n] [-q] [-R] [-v] [-w] [-y] [-d var=value] [-f distfile] [-m host] ... [label] where, -d var=value sets the value of the variable var to value.
Distributing Files Using rdist Starting rdist Table 5-2 describes all the other rdist command-line options. Table 5-2 rdist Command-Line Options Option Name Chapter 5 Description -b Performs a binary comparison and updates files if they differ. Without this option, rdist updates files only if the size or modification time differs. -h Follows symbolic links on the master host and copies the files that the link points to. Without this option, rdist copies the name of a symbolic link.
Distributing Files Using rdist Starting rdist Example Output on the Master Host Following is the output displayed on the standard output on the master host, when rdist is started without command-line options: % /usr/bin/rdist updating host lassie installing: myprog.c special "cc" notify @lassie (bentley@tbear) updating host benji installing: myprog.c special "cc" notify @benji (bentley@tbear) An example distfile is as follows: HOSTS = (lassie benji ) FILES = ( myprog.
Distributing Files Using rdist Troubleshooting rdist Troubleshooting rdist The errors, warnings, and other messages encountered while using rdist are displayed on the standard output of the master host. You can use the notify command to mail a list of the updated files and errors that may have occurred to the specified users on the remote host being updated. To mail the list to a user that is not on the remote host, ensure that you specify the mail recipient as user@host.
Distributing Files Using rdist Troubleshooting rdist • 54 An executable version of rdist is not available in the /usr/bin on directory of the remote system.
6 Executing Commands with remsh remsh allows you to execute commands on a remote HP-UX or UNIX host. remsh is similar to rsh command in 4.2 BSD and later versions.
Executing Commands with remsh Enabling remsh Enabling remsh Before you can use remsh to execute commands on a remote host, you must configure the remote host in one of the following methods: • You must have an account on the remote host with the same login name as your local login name, and the name of your local host must be in the remote host’s /etc/hosts.equiv file. • You must have an account on the remote host, and the name of your local host and your local login name must be in a .
Executing Commands with remsh Using remsh Using remsh The remsh command is of the following syntax: remsh remote_host [-l remote_login_name] command[\;command...] If you do type any command with remsh on the command line, remsh interprets any option in the command line as rlogin option and runs the rlogin command. Shell metacharacters, such as, <, |, or >>, are interpreted on the local host, only if you enclose them in double quotes.
Executing Commands with remsh Using remsh 58 Chapter 6
7 Listing Hosts with ruptime ruptime lists status information about HP-UX or UNIX hosts on the local area network. This information is useful in identifying the network hosts that you can use, and how responsive each host is likely to be over the network.
Listing Hosts with ruptime Using ruptime Using ruptime For each network host, ruptime displays a status line in the following format: hostname up|down days+hours:minutes n users load n.nn, n.nn, n .nn hostname Specifies the name of a host on the network. One line is displayed for each host on the local network running the rwhod daemon. up|down Specifies the status of the host. If the local host stops hearing from a remote host’s rwhod daemon, that host is considered as down.
Listing Hosts with ruptime ruptime Examples ruptime Examples The following example lists hosts in alphabetical order and includes idle users in the output: ruptime -a hpabca hpabcb hpabcc hpabcd down down up up 14+08:34 1:13 1+17:40, 14+06:49, 6 users, 3 users, load 0.18, 0.13, 0.09 load 0.10, 0.38, 0.
Listing Hosts with ruptime ruptime Examples 62 Chapter 7
8 Listing Users with rwho rwho lists information about HP-UX or UNIX hosts on the local area network. This information is useful in identifying who is logged into the hosts on the network and who is likely to be at their terminal or workstation.
Listing Users with rwho Using rwho Using rwho For each user logged into a network host, rwho displays an information line in the following format: user host.line month day hours:minutes hours:minutes user Specifies the user’s login name. host Specifies the host to which the user is logged in. Only hosts running the rwhod daemon are displayed. line Specifies the user’s terminal line. month day Specifies the date the user logged in.
Listing Users with rwho rwho Examples rwho Examples The following example lists all active users and all users who have been idle for less than an hour: rwho acb bjt chas cjc dae hpabcd:ttyp3 hpabcf:tty3p3 hpabcd:tty3p3 hpabcd:tty1p2 hpabcf:ttyp2 Jun Jun Jun Jun Jun 2 2 2 2 2 08:32 09:35 07:47 07:55 08:28 :19 <--Active :27 <--Active :57 The following example lists all users logged into network hosts, including those that have been idle for more than an hour: rwho -a acb bjt chas cjc dae gen kg scb C
Listing Users with rwho rwho Examples 66 Chapter 8
9 Secure Internet Services Secure Internet Services (SIS) is an optionally enabled mechanism that incorporates Kerberos V5 authentication and authorization for remote access services: ftp, rcp, remsh, rlogin, and telnet.
Secure Internet Services Beginning with HP-UX 11.0, the product was replaced by the SIS mechanism (InternetSvcSec), which incorporates Kerberos V5 Release 1.0 authentication for the remote access services. The main advantage is that if you are running SIS, your security is enhanced because authorization is no longer required for transmitting a password in a readable form over the network.
Secure Internet Services Using the Secure Internet Services Using the Secure Internet Services The following steps describe how to use SIS: 1. Identify yourself to the Security Server, also known as the KDC (Key Distribution Center), by issuing the kinit command: kinit user_name@realm_name To identify yourself to an HP DCE Security Server, you would generally use the dce_login command rather than kinit. To identify yourself to an HP Praesidium/Security Server (P/SS), use the dess_login command. 2.
Secure Internet Services Using the Secure Internet Services If the SIS product is installed and enabled on your system, you can refer to the following manpages for more information: 70 • For information common to all the Secure Internet Services, including warning and error messages, type man 5 sis at the HP-UX prompt.
Index A anonymous ftp, 28 B backspace character, 18 binary transfer, ftp, 28 D distfile, rdist, 38 command entries, 44 creating, 42 except command, 47 except_pat command, 47 install command, 46 list of changed files, 48 notify command, 47 special command, 47 syntax, 42 variable definitions, 42 E erase character, 18 /etc/hosts.
Index user permissions, 38 version, 53 with NFS-mounted files, 53 remsh Secure Internet Services mechanism, 69 setting up for rdist, 39 .rhosts file, 25, 56 rhow status line format, 64 rlogin Secure Internet Services mechanism, 69 ruptime -a option, 60 display format, 60 example, 61 further reading, 60 over X.25 or PPL (SLIP), 60 status line explanation, 60 rwho -a option, 65 example, 65 explanation of status line, 64 further reading, 64 over X.