Problem
I want to use either the C or Korn shell as the Superuser under
SCO UNIX System V/386 or SCO Open Desktop. How do I set up an
account with root privileges that uses csh or ksh?NOTE: This article provides the steps for SCO UNIX Version 4.x, 5.x
and SCO Open Desktop 2.0 and 3.0 only. For SCO UNIX Version 2.0
and SCO Open Desktop 1.1, see another article in this database
entitled "Create superuser, login environment to use c/ksh in
UNIX 2.0; ODT 1.1.0"NOTE: This is not a supported or recommended method for giving other
accounts "root" privileges. Besides the security issues raised
by this procedure, this will also cause problems with other
utilities that check for duplicate UID values in the password
file. Two known problems are:1. When upgrading from a release prior to OpenServer 5.0.0, the "ap" utility will not bring forward duplicate UID accounts. The root account is the only account that will be propogated to the upgraded system.
2. The ScoAdmin Account utility in OpenServer 5.0.0 will fail with multiple accounts having the same UID. When trying to change a user (setting Networked Via AFPS), the ScoAdmin utility will hang and the process will have to be killed. The duplicate UID account will have to be removed in order to get the ScoAdmin Account utility working.
Please see other Technical Articles in this database to find specific ways to add "root" privileges to selected accounts. See also the _SCO OpenSever System Administration Guide_ section on "Assigning user powers" starting on page 31.
Cause
By default, the "root" login uses the standard Bourne shell, /bin/sh. This is in fact necessary for correct system operation; the default shell of the "root" login must not be changed. Changing it can lead to mysterious "Bad Hertz Value" messages from programs such as df(C) and mount(C) and may have more serious consequences.
Solution
Step I - Precautions
--------------------1 - Make a complete system backup before proceeding.
2 - Use shutdown(ADM) to bring the system down, then come back up in single user mode.
3 - Use vi(C) or another text editor when editing /etc/passwd and /.profile - do not use a word processor.
4 - Read and understand Steps II and III before proceeding.
Step II - Create the Account
----------------------------1 - If /etc/shadow exists, run pwunconv(ADM). This will move the encrypted passwords to /etc/passwd and remove /etc/shadow.
2 - Edit /etc/passwd and create a new account called "rootcsh," for example. To do this, copy the line for root to another line and change the name "root" to "rootcsh". Add the shell /bin/csh to the end of the line if a shell is not named. (Add the shell /bin/ksh to the end of the line if you are creating a Korn shell supersuer.)
It is not necessary to make any changes to the Protected Password Database, i.e. /tcb/files/auth/*/?.
3 - Run authck(ADM) with the -av options.
# /tcb/bin/authck -avAnswer "y" to update the Protected Password Databases and the Subsystem databases.
4 - A new /etc/shadow can be created with pwconv(ADM).
Step III - Set up the login environment.
----------------------------------------Perform the following steps as appropriate to set up the login environment(s) for your new superuser(s):
1 - C-shell:# cd /usr/lib/mkuser/csh
# cp login /.login
# cp cshrc /.cshrc
# cd
# chown rootcsh .login
# chown rootcsh .cshrcEdit /.login and /.cshrc as desired.2 - Korn Shell# cd /usr/lib/mkuser/ksh
# cp kshrc /.kshrc
# cd
# chown rootksh .kshrcDo not copy /usr/lib/mkuser/ksh/profile; the existing /.profile used by the Bourne shell is sufficient.
Add the following lines to root's .profile, using vi(C) or your editor of choice. Remember, do not use a word processor. ("Old>" indicates an existing line in the .profile, "Add>" indicates a line you should add.)
Old> # use default system file creation mask
Old> eval `tset -m ansi:ansi -m :\?${TERM:-ansi} -r -s -Q`Add> #set ENV to .kshrc if login user is running the ksh.
Add> if [ "$0" = "-ksh" ]
Add> then
Add> ENV=$HOME/.kshrc
Add> export ENV
Add> fiOld> [ -x /bin/mesg ] && mesg n # if mesg is installed...You can now shutdown(ADM), reboot the system and log in as "rootcsh"
or "rootksh" or whatever account you have created. Remember, as
always, to be very careful when running with root privileges and to
do so only when it is necessary for system maintenance tasks.Be aware that the passwords for the different "root" accounts will
be separate entities. They will start out the same because the new
accounts' protected password entries will have been duplicated from
"root". But when you change root's password as part of your regular
security measures, be sure to change the other accounts' passwords
as well. In order to change the password for the rootksh user, log in
as rootksh and then enter "passwd rootksh". Simply entering "passwd"
is not sufficient. Similarly, enter "passwd rootcsh" for the rootcsh
user.It is probably safest to use the same password for all root accounts since breaking into any one of them completely compromises system security; there is no point in having several different strings which a potential troublemaker might be able to guess.