Edit the following the files:


/etc/nodename
/etc/hostname.*
/etc/inet/hosts
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
/etc/defaultrouter # if necessary

Change the following directory names:


/var/crash/*

From: Eric Sherrill [mailto:sherrill@ti.com]
Sent: Friday, August 10, 2001 11:11 AM
To: focus-sun@securityfocus.com
Cc: HeathFla@reciprocal.com; Gregory Hicks
Subject: RE: ticlts, ticots, ticotsord ...


My $0.02 (okay, maybe a bit more than that!) on the 
sys-unconfig utility -
sometimes it seems to do way too much, but it is handy for 
getting a box
back to a "fresh" state.  In fact it has been around since 
SunOS 4.1 days!
Here are some more details cribbed from various man pages and SunSolve
articles:

---
from 'man sys-unconfig' on Solaris 2.6:
---
sys-unconfig does the following:

     o     Saves  current  /etc/inet/hosts  file  information  in
          /etc/inet/hosts.saved.

     o     Restores the default /etc/inet/hosts file.

     o     Removes the default hostname in  /etc/hostname.??[0-9]
          and /etc/nodename.

     o     Removes the default domainname in /etc/defaultdomain.

     o     Restores the timezone to PST8PDT in /etc/TIMEZONE.

     o     Disables the Network  Information  Service  (NIS)  and
          Network  Information  Service Plus (NIS+) if either NIS
          or NIS+ was configured.

     o     Removes the entries for this host in /etc/net/*/hosts.

     o     Removes the file /etc/inet/netmasks.

     o     Removes the password set for root in /etc/shadow.

     o     Execute all system configuration applications.   These
          applications  are  defined  by  prior  executions  of a
          sysidconfig - a  application.   (See  sysidconfig(1M)).
          When  sys-unconfig  is  run,  all  system configuration
          applications are passed one argument, -u.

     When sys-unconfig is finished, it performs  a  system  shut-
     down.
---
And from Solaris 8 man pages (note the changes!):
---
     sys-unconfig does the following:

        o  Saves  current  /etc/inet/hosts  file  information  in
           /etc/inet/hosts.saved.

        o  If the current  /etc/vfstab file contains   NFS  mount
           entries,     saves    the    /etc/vfstab    file    to
           /etc/vfstab.orig.

        o  Restores the default /etc/inet/hosts file.

        o  Removes      the       default       hostname       in
           /etc/hostname.interface  files for all interfaces con-
           figured when this command is run.  To determine  which
           interfaces  are configured, run the command 'ifconfig-
           a'.  The  /etc/hostname.interface files  corresponding
           to  all of the interfaces listed in the resulting out-
           put,  with the exception  of  the  loopback  interface
           (lo0), will be removed.

        o  Removes the default domainname in /etc/defaultdomain.

        o  Restores the timezone to PST8PDT in /etc/TIMEZONE.

        o  Disables the Network  Information  Service  (NIS)  and
           Network  Information Service Plus (NIS+) if either NIS
           or NIS+ was configured.

        o  Removes the entries for this host in /etc/net/*/hosts.

        o  Removes the file /etc/inet/netmasks.

        o  Removes the file /etc/defaultrouter.

        o  Removes the password set for root in /etc/shadow.

        o  Removes the file /etc/.rootkey.

        o  Executes all system configuration applications.  These
           applications  are  defined  by  prior  executions of a
           sysidconfig  -a  application.  (See  sysidconfig(1M)).
           When  sys-unconfig  is  run,  all system configuration
           applications are passed one argument, -u.

        o  Removes the file /etc/resolv.conf.

     When sys-unconfig is finished, it performs  a  system  shut-
     down.  sys-unconfig  is  a potentially dangerous utility and
     can only be run by the super user.

---
Stolen from SunSolve http://sunsolve.sun.com :
---
FAQ ID 2968 "How do we change hostname in Solaris 8 ?" 15 Mar 2000

The best way of altering a host's name, IP address, domain, timezone,
etc., has always been /usr/sbin/sys-unconfig.

This command asks for a new system's configuration consists of
hostname, Network Information Service (NIS) domain name, timezone,
IP address, IP subnet mask, and root password. This command makes
sure there are no applications running that get the configuration
changed while they are running (by shutting down the OS), and makes
sure the configuration details are changed in all the right places.
Please read man page of sys-unconfig(1M) before proceeding.

Please also check that if there is a /etc/inet/ipnodes file exists and
if there is IPv4 ip address entry in that file for new hostname, then
that entry should be same as the one in /etc/hosts file.

Another method, which is not recommended is, changing 
hostname manually
in files:

/etc/nodename
/etc/inet/hosts
/etc/hostname.le0 or hostname.hme0 or an equivalent file
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
/etc/inet/ipnodes (if file exists and if hostname entry exists)

After modifying the above files, reboot the system.

Above two methods can change hostname of system. But for other
operations depending on configuration, you may also have to change the
information in /etc/inet/ipnodes, DNS files, NIS server entries,
application files etc. having hostnames.

---
Note - sys-unconfig does not back up any of this stuff except 
as mentioned
in the manpages, so you must do that yourself!

For those of us still running SunOS 4.x - there is also an equivalent
command:
---
SunSolve SRDB ID: 3873

1) execute /usr/etc/install/script/sys-unconfig in 4.0.3c or
   /usr/etc/install/sys-unconfig in 4.1 and 4.1.1  ## -also 
in 4.1.3-4.1.4 -
ERS

   At bootup, system will ask whether you will join a network or not.

OR

2) as needed, modify the following files on system:

   /etc/hosts: modify the hostname or ip address

   /etc/hostname.??[0-9]: mv to .xx0 for non-network standalone or
                          mv to .??[0-9] for network client

   /etc/defaultdomain:
        non-network: don't modify
        network client running nis: create file with domainname other
        than "noname"

   /etc/rc.local:
        non-network: comment out ypbind
        network client running nis: uncomment ypbind

        Note: if running NIS, verify client is in yp maps
--
also note - in SunOS /etc/rc.* scripts there are often 
'ifconfig' commands,
check for correct IP addresses, subnet masks etc. if you are 
moving the box!

--
Eric R. Sherrill, WF Software Systems Engineer
Texas Instruments HFAB1 Automation Systems
Stafford, TX 77477-3006
281-274-4133


-----Original Message-----
From: Gregory Hicks [mailto:ghicks@cadence.com]
Sent: Thursday, August 09, 2001 12:50 PM
To: focus-sun@securityfocus.com; HeathFla@reciprocal.com
Subject: RE: ticlts, ticots, ticotsord ...


Just editing /etc/hosts went bye-bye with the demise of SunOS 4.x...

My favorite command line to change hostname without 'sys-unconfig'
(although my preferred way is to run sys-unconfig...) is as follows:

cd /etc
vi host* node* net/tic*/hosts
[6 files to edit]
[...reboot...]

That's on a one interface machine...

As Darren pointed out, there are other files that may need editing...

Regards,
Gregory Hicks

> From: Heather Flanagan 
> Date: Mon, 6 Aug 2001 16:00:50 -0400
>
>
> > On Sun, 5 Aug 2001, Jan-Philip Velders wrote:
> >
> > > in the midst of a major renumbering operation (3 class C
[...snip...]
>
> I'm encountering this, myself.  Thing is, I'm using the 
same procedure
to
> change the hostname that I used with my Solaris 2.6 boxes - this new
one is
> Solaris 8.  Procedure is/was:
> hostname [new name]
> vi /etc/inet/hosts
>
> This however doesn't change the hostname in those /etc/net 
files.  Has
the
> procedure changed?
>
> -hf
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Heather Flanagan, GSEC        UNIX Systems Administrator
> Reciprocal, Inc.              (919) 462-4642
>

---------------------------------------------------------------------
Gregory Hicks                           | Principal Systems Engineer
Cadence Design Systems                  | Direct:   408.576.3609
555 River Oaks Pkwy M/S 6B1             | Fax:      408.894.3479
San Jose, CA 95134                      | Internet: ghicks@cadence.com