Logging In, Logging Out, and Shutting Down

This chapter includes:

Neutrino is a multiuser operating system; it lets multiple users log in and use the system simultaneously, and it protects them from each other through a system of resource ownership and permissions.

Depending on the configuration, your system boots into either Photon (i.e. graphical) or text mode and prompts you for your user ID and password. For more details, see the Controlling How Neutrino Starts chapter in this guide.


Note: Your system might have been configured so that you don't have to log in at all.

root or non-root?

When you first install Neutrino, the installation process automatically creates a single user account called root. This user can do anything on your system; it has what Windows calls administrator's privileges. UNIX-style operating systems call root the superuser.

Initially, the root account doesn't have a password. To protect your system, you should:

The default command-line prompt indicates which user ID you're using:

For information about changing the prompt, see .kshrc in the Examples appendix.

Logging in

Photon mode

If you've configured your system to start Photon, the system automatically starts phlogin2 or phlogin to display a login dialog. Enter your user name or click your user icon, enter your password, and then click Login.

Text mode

If your system is configured to boot into text mode, the system automatically starts the login utility, which prompts you for your user name and then your password.


Note: If you type an invalid user name, the system prompts you for the password anyway. This avoids giving clues to anyone who's trying to break into the system.

Text mode on an x86 machine could be on a physical console supplied by devc-con or devc-con-hid. On any other type of machine, you could be connecting to the target via a serial port or TCP/IP connection.

Once you've logged in

After you've logged in, the system automatically runs the /home/username/.profile script. This script lets you customize your working environment without affecting other users. For more information, see Configuring Your Environment.

To change your password:
Use the passwd command. This utility prompts you for your current and new passwords; see Managing your own account in Managing User Accounts.
To log in as a different user:
Enter login at the command prompt, and then enter the user's name and password.

Note: The su (switch user ID) utility also lets you run as another user, but temporarily. It doesn't run the user's profiles or significantly modify the environment. For more information, see the Utilities Reference.

To determine your current user name:
Use the id command.

Logging out

Photon mode

To log out of Photon:
  1. Select Log Out from the Launch or Desktop menu, or enter phshutdown on the command line. The shutdown dialog appears.
  2. Select Logout (End Photon session) and click Ok. If your system is configured to start Photon, the phlogin2 or phlogin dialog reappears. If you started Photon manually from text mode, the system returns to text mode.

Even if your system started Photon automatically, you can exit your Photon session and run in text mode.

To switch from Photon to text mode:
  1. In the login dialog, click Shutdown. The shutdown dialog appears.
  2. Enable Exit to text mode and click Ok.

If you start a terminal session from within Photon — for example, by clicking Terminal on the shelf — the pterm utility starts a shell that runs as the current Photon user. You can log in and out as a different user, just as in text mode, but when you log out, the pterm window closes.

Text mode

To log out of text mode:
Enter logout at the command prompt. You can also log out by terminating your login shell; just enter the exit shell command or press Ctrl-D.

Shutting down and rebooting

You rarely need to reboot a Neutrino system. If a driver or other system process crashes, you can usually restart that one process.


Note: Don't simply turn off a running Neutrino system, because processes might not shut down properly, and any data that's in a filesystem's cache might not get written to the disk. For information about reducing this effect, see Filesystems and block I/O (devb-*) drivers in the Fine-Tuning Your System chapter.

To shut down or reboot the system in text mode, use the shutdown command. You can do this only if you're logged in as root. This utility has several options that let you:

In Photon, you can run phshutdown from the command line, or choose Shutdown from the Launch or Desktop menu. By default, you don't have to be root to do this.

Before shutdown and phshutdown shut down the system, they send a SIGTERM signal to any running processes, to give them the opportunity to terminate cleanly. For more information on these utilities, see in the Utilities Reference.