Chapter 13. The login environment

When you log in to the system, before you are even presented with the command prompt, a couple of tasks happen. After you have typed in your login name and password, the system checks that you are indeed a valid user. It does this by checking the /etc/passwd file. If your login name is OK and the password you entered is valid, the next process can begin, which is your login environment.

In this chapter we will cover:

  • the process of logging in;

  • the /etc/profile;

  • the $HOME.profile; and

  • customizing your $HOME.profile.

Before we look at the next process let’s first look at the /etc/passwd file, which is a text file. You can alter any of the text fields including the password fields, so be careful. The passwd file contains seven fields, each of which is separated by a colon. Below is a partial listing of a passwd file. I have put column numbers at the top, so you can easily identify each field.

Let’s look at some of the fields. The first field is the login name The second field is the encrypted password. The fifth field is the user’s full name. The sixth field is the user’s home directory. The seventh field is the shell that is to be used by the user. In this case ‘/bin/sh’ means the default shell which is by convention the Bourne shell.

There are other types of passwd files around; one version is where the actual passwd field is held in another file. The above is the most common format.

After a successful login, two environment files are then executed. The first is a file called /etc/profile and the second is a file called .profile, located in your $HOME (home) directory.

There are other initializing files that are processed, but we are only concerned with the profile files.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.118.14