Technical article 114521

When I add users with either "scoadmin" or "useradd", how can I ensure that their .profiles are always the same regardless of which utility I choose?

OpenServer 6.0.0UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.2UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

When I add users with either "scoadmin" or "useradd", I want to ensure that their .profiles are always the same, no matter which of these two utilities I choose to use.

Cause

When a new user is added by "useradd" or within "scoadmin account", the user's default .profile is taken from a "skel" subdirectory.

"useradd" takes it from /etc/skel "scoadmin account" takes it from /usr/lib/scoadmin/account/skel

Solution

To make them the same, run the following commands:

mkdir /local
find /etc/skel -print | cpio -pdumv /local
ln -s /usr/lib/scoadmin/account/skel /etc/skel

Now, when you add a user via "useradd" or "scoadmin account", their .profiles will be the same.

The original /etc/skel is copied to /local/skel, should you wish to use the .profile there as a preference.

Other files that are copied in are:

 <pre>
-rw-r--r--    1 testuser other           480 May 24 09:42 .cshrc
-rw-r--r--    1 testuser other            20 Jun 25 08:57 .env
-rw-r--r--    1 testuser other           932 May 24 09:42 .kshrc
-rw-r--r--    1 testuser other           642 May 24 09:42 .login
-rw-r--r--    1 testuser other           822 May 24 09:42 .profile
-rw-------    1 testuser other            32 Jun 25 09:11 .sh_history
-rw-r--r--    1 testuser other            51 May 24 09:22 .vtlrc
</pre>
Alternatively, you can also run the "useradd" command with the "-k"
option to specify a different skel directory other than /etc/skel.
NOTE:     The default $PATH for "root" is /sbin:/usr/sbin:/usr/bin:/etc which
          is defined by the "login" binary.  Other users is /usr/bin.

This can be reset by either /etc/profile or the user's .profile in their $HOME directory.

See also

useradd(1M)
See the online documentation located at:
http://<my_server>:457

From the Xinuos technical article database, record 114521. Reproduced with permission. The original is at www.sco.com/ta/114521, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.