21.3.3. autofs Common Tasks


21.3.3.1. Overriding or augmenting site configuration files

It can be useful to override site defaults for a specific mount point on a client system. For example, assuming that the automounter maps are stored in NIS and the /etc/nsswitch.conf file has the following directive:
automount:  files nis
Copy to Clipboard Toggle word wrap
and the NIS auto.master map file contains the following:
/home auto.home
Copy to Clipboard Toggle word wrap
Also assume the NIS auto.home map contains the following:
beth     fileserver.example.com:/export/home/beth
joe      fileserver.example.com:/export/home/joe
*        fileserver.example.com:/export/home/&
Copy to Clipboard Toggle word wrap
and the file map /etc/auto.home does not exist.
For the above example, lets assume that the client system needs to mount home directories from a different server. In this case, the client will need to use the following /etc/auto.master map:
/home /etc/auto.home2
+auto.master
Copy to Clipboard Toggle word wrap
And the /etc/auto.home2 map contains the entry:
*   labserver.example.com:/export/home/&
Copy to Clipboard Toggle word wrap
Because only the first occurrence of a mount point is processed, /home will contain the contents of /etc/auto.home2 instead of the NIS auto.home map.
Alternatively, if you just want to augment the site-wide auto.home map with a few entries, create a /etc/auto.home file map, and in it put your new entries and at the end, include the NIS auto.home map. Then the /etc/auto.home file map might look similar to:
mydir someserver:/export/mydir
+auto.home
Copy to Clipboard Toggle word wrap
Given the NIS auto.home map listed above, an ls of /home would now give:
~]$ ls /home
beth  joe  mydir
Copy to Clipboard Toggle word wrap
This last example works as expected because autofs knows not to include the contents of a file map of the same name as the one it is reading and so moves on to the next map source in the nsswitch configuration.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat