Users can put a .copy_files file and .link_files file into their home directory at the label that corresponds to their minimum sensitivity label. Users can also modify the existing .copy_files and .link_files files at the users' minimum label. This procedure is for the administrator role to automate the setup for a site.
Before You Begin
You must be in the System Administrator role in the global zone. For details, see How to Enter the Global Zone in Trusted Extensions.
You are going to add .copy_files and .link_files to your list of startup files.
# cd /etc/skel # touch .copy_files .link_files
# pfedit /etc/skel/.copy_files
For a discussion of which files to include in startup files, see About the User Work Environment in Managing User Accounts and User Environments in Oracle Solaris 11.3.
The P indicates the Profile shell.
The X indicates the letter that begins the shell's name, such as B for Bourne, K for Korn, C for a C shell, and P for Profile shell.
In this example, the system administrator configures files for every user's home directory. The files are in place before any user logs in. The files are at the user's minimum label. At this site, the users' default shell is the C shell.
The system administrator creates a .copy_files and a .link_files file with the following contents:
## .copy_files for regular users ## Copy these files to my home directory in every zone .mailrc .mozilla .soffice :wq
## .link_files for regular users with C shells ## Link these files to my home directory in every zone .bashrc .bashrc.user .cshrc .login :wq
## .link_files for regular users with Korn shells # Link these files to my home directory in every zone .ksh .profile :wq
In the shell initialization files, the administrator adds customizations.
## .cshrc file setenv EDITOR emacs setenv ETOOLS /net/tools/etools
## .ksh file export EDITOR emacs export ETOOLS /net/tools/etools
The customized files are copied to the appropriate skeleton directory.
# cp .copy_files .link_files .bashrc .bashrc.user .cshrc \ .login .profile .mailrc /etc/skelC # cp .copy_files .link_files .ksh .profile .mailrc \ /etc/skelK
If you create a .copy_files files at your lowest label, then log in to a higher zone to run the updatehome command and the command fails with an access error, try the following:
Verify that from the higher-level zone you can view the lower-level directory.
higher-level zone# ls /zone/lower-level-zone/home/username ACCESS ERROR: there are no files under that directory
If you cannot view the directory, then restart the automount service in the higher-level zone:
higher-level zone# svcadm restart autofs
Unless you are using NFS mounts for home directories, the automounter in the higher-level zone should be loopback mounting from /zone/lower-level-zone/export/home/username to /zone/lower-level-zone/home/username.