System Administration Guide: Advanced Administration

Changing System Information

This section describes commands that enable you to change general system information.

How to Set a System's Date and Time Manually

  1. Become superuser.

  2. Enter the new date and time.


    # date mmddHHMM[[cc]yy]
    

    mm

    Month, using two digits. 

    dd

    Day of the month, using two digits. 

    HH

    Hour, using two digits and a 24-hour clock. 

    MM

    Minutes, using two digits. 

    cc

    Century, using two digits. 

    yy

    Year, using two digits. 

    See date(1) for more information.

  3. Verify that you have reset your system's date correctly by using the date command with no options.

Example—Setting a System's Date and Time Manually

The following example shows how to use the date command to manually set a system's date and time.


# date
Thu Jun 21 13:59:15 MDT 2001
# date 0621141001
Thu Jun 21 14:10:00 MDT 2001

How to Set Up a Message-of-the-Day

Edit the message-of-the-day file, /etc/motd, to include announcements or inquiries to all users of a system when they log in. Use this feature sparingly, and edit this file regularly to remove obsolete messages.

  1. Become superuser.

  2. Edit the /etc/motd file and add a message of your choice.

    Edit the text to include the message that will be displayed during user login. Include spaces, Tabs, and Returns.

  3. Verify the changes by displaying the contents of the /etc/motd file.


    $ cat /etc/motd
    Welcome to the UNIX Universe. Have a nice day.

Example—Setting Up a Message-of-the-Day

The default message-of-the-day, provided when you install Solaris software, contains SunOS version information:


$ cat /etc/motd
Sun Microsystems Inc.   SunOS 5.9       Generic  May 2002

The following example shows an edited /etc/motd file that provides information about system availability to each user who logs in.


$ cat /etc/motd
The system will be down from 7:00 a.m to 2:00 p.m. on
Saturday, July 7, for upgrades and maintenance.
Do not try to access the system during those hours.
Thank you.

How to Change a System's Host Name

A system's host name is specified in several different locations.

Remember that you will need to update your name service database to reflect the new host name.

  1. Become superuser.

  2. Change the system's host name in the following files:

    • /etc/nodename

    • /etc/hostname.xxy

    • /etc/inet/hosts

    • /etc/net/ticlts/hosts

    • /etc/net/ticots/hosts

    • /etc/net/ticotsord/hosts

  3. (Optional) If using a name service, change the system's host name in the hostfile.

  4. Reboot the system to activate the new host name.


    # init 6