Logging In

As with any multi-user system, Unix requires that you log in before you can do anything. When you log in, the login program starts a "shell program" for you. It's this shell program that prints the prompt and interprets your commands. The login program also sets your working directory to your home directory. Each user's home directory might be named something like /home/username where "username" is that user's username.

Although it's not necessary, it is traditional to make a user's home directory have the same name as the user. However the exact location of the home directory structure varies from system to system. On some systems it might be under the /usr directory (this is an rather old-fashion configuration). On other systems it might be under /home. On very large systems, there might be a directory for each letter of the alphabet with home directories under each as appropriate. For example, jjones's home directory might be /users/j/jjones. This approach keeps the number of home directories in any one directory relatively small.

Also when you log in, your shell program will execute one or more scripts of commands. The traditional Bourne Shell first runs the script /etc/profile. Then it runs the script .profile located in your home directory. The system administrator can set global parameters in /etc/profile, and you can customize your environment by editing .profile.

It is important to understand that multiple shell programs (or command processors) exist and are in wide usage. On Linux systems the "Bourne Again Shell" (bash) is commonly the default. It is largely upwardly compatible with the traditional Bourne Shell. However the "C Shell" (csh) and "Korn Shell" (ksh) have significant user communities. The commands accepted by these shells are mostly the same since most commands are actually separate programs that are executed by the shell. However, many details, such as the location(s) of the log in scripts, vary from shell to shell.

When you are done using the system, you must log out. Type exit at the shell prompt to terminate your shell program. In general if you forget to log out, the next person who uses your terminal will find that you are still logged in. They will have total access to your files.

In more modern environments it is common to interact with a Unix system by way of a "Secure Shell" (SSH) connection. SSH refers to a network protocol that encrypts that data between the client program (a terminal emulator that "speaks" the SSH protocol), and the SSH server on the Unix host. Many different SSH client programs exist and each has its own way of logging in and it's own manner of configuration. However, once you have logged into the Unix host, your experience of using the system is largely the same as I described above. You interact with a shell program such as bash, typing commands that execute on the Unix host.