System Administration Guide: Network Services

ProcedureHow to Search for and Remove .rhosts Files

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Search for and remove .rhosts files by using the find(1) command.

    # find home-directories -name .rhosts -print -exec rm {} \;

    Identifies the path to a directory where users' home directories are located. Note that you can enter multiple paths to search more than one home directory at a time.

    -name .rhosts

    Identifies the file name.


    Prints the current path name.

    -exec rm {} \;

    Tells the find command to apply the rm command to all files that are identified by using the matching file name.

    The find command starts at the designated directory and searches for any file that is named .rhosts. If it finds such as file, find prints the path on the screen and removes it.

Example 29–1 Searching for and Removing .rhosts Files

The following example searches and removes .rhosts files in all the user's home directories that are located in the /export/home directory.

# find /export/home -name .rhosts -print | xargs -i -t rm {} \;