5. Switching Users



 

 


One feature of Linux that cannot be duplicated by Windows is that Linux is not only multitasking, but it is also multiuser. This means that unlike Windows, multiple users can be logged into a single computer simultaneously. This is handy for an administrator like myself, because I can login to another computer remotely and perform upgrades and make configuration changes while the person sitting in front of the computer continues to work on her spreadsheet. Of course I am not using the Desktop while I perform these tasks, primarily because – take my word for it – the command line is much more efficient for those tasks. But I could login to the remote computer using the GUI Desktop using tools that come free with Linux, should I so desire.

Linux has always – at least as long as I have been using it – provided the capability for multiple logins. Red Hat Linux and Red Hat Fedora Linux have typically provided for 7 virtual terminals for text mode logins. If a graphical interface were used, it was assigned as virtual terminal 7, or vt7. In this case vt1 through vt6 would be text mode sessions and vt7 would be the graphical session. Each virtual terminal is assigned to a Function Key corresponding to the terminal number. So vt1 would be assigned to function key F1, and so on.

It is easy to switch to and from these sessions. On your computer you can hold down the Ctrl and Alt keys and press F2 to switch to vt2. Then hold down the Ctrl and Alt keys and press F7 to switch to vt7 and the graphical interface.

KDE Menu Switch User

Figure 1: The bottom of the KDE Menu provides options to lock the session, logout and switch to another user. The KDE Desktop Popup Menu also provides these same capabilities.


Recent (as of this writing) versions of Fedora, starting with Core 4 and through Fedora 11 (They dropped the “Core” designation) allow multiple GUI logins for users at the keyboard. This means that another user can sit down at your computer and use it while you are still logged in. You cannot both use the computer at the same time if you both have to use the same monitor, mouse and keyboard, but you do not have to logout in order to let someone else have access to it. This is useful if multiple users share the same computer, or if a guest just needs temporary access to a computer.

Although you may never need this feature, I found it to be of great value in the writing of this book. It allowed me to login as multiple users and make screen shots of user accounts with “pristine” desktops, which mine is not.

Starting a Session as a New User

There are two ways to begin switching to a new user. First, you can right click on the KDE Desktop and the Desktop pop up menu provides the three options, Logout, Lock Session, and Switch User. The KDE Menu accessible from the KDE Panel Menu Icon also provides these same three options. Click on the green Switch User menu choice and your have to more options as shown in Figure 2. One choice is to lock the current session and start a new one, and the other choice is to simply start the new session.

KDE Switch User Sub-Menu

Figure 2: The KDE Switch User submenu.

Notice that the one graphic session running in Figure 2 is virtual terminal 7, or vt7. The second graphical session would be vt8, the third graphical session would be vt9, and so on.

KDE Start New Session Warning

Figure 3: The New Session warning message tells you how to switch between active sessions.

You should normally choose to lock the current session while you start the new one. This is for security purposes because the usual reason for switching users is to allow another user access to the computer. You do not, however, want that other person to be able to switch back to your session and possible view or damage sensitive data, either accidentally or intentionally.

After clicking on the desired menu choice for starting your new session, the New Session warning window is displayed, as shown in Figure 3. This window describes the two ways in which you can switch between active sessions.

Switching Between Sessions

Notice the last line in Figure 2, the KDE Switch User submenu. This line shows which session is currently active. If there were multiple sessions active, they would all be listed here, and you could simply click on the one you would switch to. The first graphical session is assigned to vt7 and the second would be assigned to vt8 and so on. It is not possible to use the Switch User submenu to switch to a text mode session in virtual terminals one through six.

The other option you have for switching between sessions is explained in the New Session warning message shown in Figure 18 and in the text above. You can hold down the Ctrl and Alt keys and press the function key that corresponds to the virtual terminal in which the desired graphical session is running. Using this method to switch sessions also allows you to switch to one of the text mode sessions in virtual terminals one through six.

Ending a Session

It is very easy to end a session. Simply logout as you would if there were only a single session. Use the KDE Menu, the Desktop Menu, or the Lock/Logout button on the KDE Panel if you have added it there, and click on the Logout icon. This will close the currently active session and return you to the previous session. You can also lock your session and switch back to the previous one.

When all users have finished using the computer, be sure to logout of all active sessions.