How to create the .netrc file

Posted on

These steps describe how to create and edit the $HOME/.netrc file:

  1. You must have a copy of the /usr/samples/tcpip/netrc file.
  2. The securetcpip command must not be running on your system.

To create the .netrc file:

  1. Copy the /usr/samples/tcpip/netrc file to your $HOME directory by typing the following command: cp /usr/samples/tcpip/netrc $HOME
  2. Edit the $HOME/netrc file to supply the appropriate HostNameLoginName, and Password variables. For example:machine host1.austin.century.com login fred password bluebonnet
  3. To set the permissions on the $HOME/netrc file to 600 by using the chmod command at the command line prompt ($), type:chmod 600 $HOME/netrc
  4. Rename the $HOME/netrc file to $HOME/.netrc file. The initial period (.) causes the file to be hidden.mv $HOME/netrc $HOME/.netrc

The $HOME/.netrc file can contain multiple login definitions and up to 16 macros per login definition.