z/OS Communications Server: IP User's Guide and Commands
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


NETRC data set

z/OS Communications Server: IP User's Guide and Commands
SC27-3662-00

The user_id.NETRC data set (/$HOME/.netrc, in z/OS UNIX) provides you with an alternative to specifying your user_id and password values as FTP parameters when you want to FTP to a remote host. The following example shows you how to specify the user_id.NETRC data set:
 machine mvs1.tcp.raleigh.ibm.com login user28 password user28
 machine 9.67.112.25 login user28
 machine FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 login user28 

The keywords machine, login, and password must be lowercase. The variables user_ID and password might be case sensitive, depending on the remote host. (For example, when using UNIX or AIX® hosts, the user_ID and password values are case sensitive.) The hostname variable that is specified after the machine keyword can include scope information, as described in the support for scope information in the z/OS Communications Server: IPv6 Network and Application Design Guide.

Guidelines:
  • If you include scope on the FTP command (for example, hostname%scope), there should be an entry defined in the user_id.NETRC data set that includes scope as part of the hostname value following the machine keyword. Defining this entry ensures that the correct user_id and password values are selected.
  • Although the FTP client allows the keywords for a single machine entry to be split across multiple lines, REXEC requires all of the values to be on a single line. If you specify the ACCOUNT keyword in the NETRC file, specify the password keyword; otherwise, the FTP client uses NULL as the password and sends it to the server.
Rules:
  • Code a password phrase that contains blanks in NETRC by enclosing the entire password phrase in quotation marks. You can use single or double quotation marks. If the password phrase itself contains a quotation mark, use the other style of quotation mark to enclose the password phrase.
    Example: Code the password phrase What's up, Doc? in NETRC as "What's up, Doc?" but not as 'What's up, Doc?'.

    If you code user data for the z/OS® FTP server user exit FTCHKPWD in NETRC, and either user data or the password contains blanks, enclose the password and user data in quotation marks.

    Example: Code the password phrase What's up, Doc? with the user data FTCHKPWD exit parameter as "What's up, Doc?:FTCHKPWD exit parameter".
  • Do not use quotation marks to enclose a password phrase that is comprised only of any of the following characters:
    • Uppercase or lowercase letters
    • Numerals from 0 to 9
    • The following special characters:
      • @
      • #
      • $
      • -
      • {
      • .
      • (
      • )
      • *
      • %
      • +
    Example: Code the password phrase JoeIBMer@ibm.com in NETRC as JoeIBMer@ibm.com, but not as 'JoeIBMer@ibm.com', nor as "JoeIBMer@ibm.com".
Restriction:
  • A password phrase that you code in the NETRC data set or file must not contain both single quotation mark and double quotation mark characters. You can use either style of quotation marks in the password phrase, but not both.
    Example: The password phrase What's up, Doc? is valid because it contains only single quotation marks. Code it in NETRC as "What's up, Doc?". The password phrase "What's up, Doc?" with the double quotation marks as part of the password phrase cannot be entered at the z/OS FTP client or coded in NETRC because it contains both styles of quotation marks.
To invoke the user_id.NETRC data set and automatically log on to the remote host named MVS1, enter the FTP command as shown in the following example:
  User:   ftp mvs1
System:
           IBM FTP CS V1R5 
           FTP: using TCPCS
           Connecting to: 9.67.113.61 port: 21.
           220-FTPD1 IBM FTP CS V1R2 at MVSVIC04, 12:00:51 on 2003-01-12.
           220 Connection will close if idle for more than 5 minutes.
           >>>USER user28
           331 Send password please.
           >>>PASS ********
           230 USER28 is logged on.  Working directory is "/u/user28".
           Command:

In order to bypass definitions in a user_id.NETRC data set for an FTP session, specify the -n parameter. For information about using the user_id.NETRC data set in a batch file, see Submitting FTP requests in batch.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2013
This information center is Built on Eclipse™ ( www.eclipse.org ).