Archive for the 'PHP5' Category

Web site designers - 440 CHAPTER 30 MANAGING USERS Creating a

Friday, March 21st, 2008

440 CHAPTER 30 MANAGING USERS Creating a new user this way will automatically add him to the users group. However, the Ubuntu way of working is to give each user his own group based on his username. Therefore, you will always need to create a new group for the user before you create the user account itself, using the groupadd command, as follows: sudo groupadd Then you need to specify this group with the -g switch when creating a new user: sudo useradd -m -g For example, the following command creates a user called raymond and adds him to the group raymond: sudo useradd -m -g raymond raymond There s another more annoying issue relating to groups when you re creating a user account at the command line. Most users are members not only of their own group, but also of several system groups. These groups relate to various hardware and software functions. For example, membership of the audio group is required if the user wants to be able to use the sound card and hear audio. This is necessary because of the way Linux works. Therefore, you need to add new users to these groups if they re to make full use of the system. These groups are described as supplementary groups. Use the id command to display user and group information. On my test system, typing the following: id keir revealed the following groups: uid=1000(keir) gid=1000(keir) groups=1000(keir),4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44 (video),36(plugdev),104(lpadmin),105(scanner),106(admin) All those after my main group, 1000(keir), are supplementary groups. For a list of what they do, see Table 30-1. Table 30-1. System Groups Within Ubuntu Group Definition adm Used for system logging dialout Required for use of serial port devices, such as older modems cdrom Allows user to access CD/DVD-ROM floppy Allows user to access floppy disk drive audio Enables sound output for user dip Required for use of dial-up modems

CHAPTER 30 (Web hosting compare) MANAGING USERS Caution Many groups

Thursday, March 20th, 2008

CHAPTER 30 MANAGING USERS Caution Many groups are listed in the Main Group drop-down list. Nearly all of these relate to the way the Linux operating system operates and can be ignored. You should never, ever delete any of these, or add a user to them! User Privileges: The settings on this tab offer much more control over what a user can and cannot do on the system. Here, you can prevent users from using certain hardware, such as scanners or modems. You can also control whether the user is able to administer the system. Simply put a check alongside any relevant boxes. Deleting a user is simply a matter of highlighting the username in the list and clicking the Delete button. Note that the user s /home/ directory won t be deleted. You must do this manually with superuser powers, and it s best accomplished from the command-line prompt (see Chapter 14 for an introduction to basic file-manipulation shell commands). Creating and Deleting Groups via the GUI Adding a group is simply a matter of clicking the Groups tab in the Users and Groups program window (System . Administration . Users and Groups). After clicking the Add button, you ll be prompted to give the group a name. The group ID (GID) will be automatically filled in for you, but you could choose a different number if you have good reason to do so (remember to keep it above 1000 to keep in line with the way Ubuntu operates). It isn t essential that you add users to the group there and then but, once again, you ll see a lot of user accounts in the list that belong to the system and are vital to the way Ubuntu operates. You shouldn t add any of these to your new group, and you should never, ever delete any of these user accounts! As with user accounts, deleting a group is simply a matter of highlighting it in the list and clicking the Delete button. You should ensure that the group no longer has any members before doing this because, perhaps surprisingly, Ubuntu won t prevent you from deleting an active group (although it will warn you that this is a bad thing to do). Deleting an active group has the effect of preventing all users who belong to it from logging in. Adding and Deleting Users and Groups at the Command Line You can create new users at the command-line shell by using the useradd command. This command must be run with superuser powers, which is to say that it must be prefaced with the sudo command. The command to add a user is normally used in the following way: sudo useradd -m The -m command option tells the command to create a home directory for the user. Used on its own, useradd merely updates system files with the new user s details and nothing else. There are several other useful command options, which can be discovered by a quick browse of the command s man page.

438 CHAPTER 30 MANAGING USERS Figure 30-1.

Thursday, March 20th, 2008

438 CHAPTER 30 MANAGING USERS Figure 30-1. Adding new users and groups is easy courtesy of the Users and Groups program. Fill out the fields on the Account tab, and optionally the Advanced and User Privileges tabs, as follows: Account: As during initial installation, you re invited to enter a username for the user as well as the real name. The username is how the user is identified to the system, while the real name is how the user will be identified to other users. You can enter contact information under the relevant heading if you wish, but this isn t strictly necessary. However, you do need to set an initial password for the user. To ensure accuracy, enter it twice. Alternatively, the system can generate a random password from letters and numbers, but this may be harder for the user to remember. Advanced: Here, you can alter various additional settings for the user. The chief one is assigning a user profile. The default for additional users is Desktop. This is a restricted account, which means that the user won t be able to administer the system or change settings. If you want the user to have these powers, click Administrator. Beneath this, you ll see various technical settings that can remain unchanged. However, you might like to change the main group for the user. By default, he will belong to a unique group based on his username (indicated by $user). However, you could add the new user to your own group by selecting it from the list. Depending on your use of file permissions, this could grant the user access to your files.

Free web hosting with ftp - CHAPTER 30 MANAGING USERS Tip You can

Wednesday, March 19th, 2008

CHAPTER 30 MANAGING USERS Tip You can tell when you re logged in as root user because the command prompt will end with a hash (#). When logged in as an ordinary user, it ends with a dollar sign ($). The hash symbol should be seen as a warning that you now have unrestricted control over the system, so be careful what you type and double- check everything before hitting Enter! As an alternative to setting the root password, you can simply type the following whenever you want to switch to the root user account: sudo su You ll be prompted for your login password, in exactly the same way as if you had just preceded a command with sudo. After this, you ll be logged in as the root user. To quit the root user account, type exit. UIDs and GIDs Although we talk of user and group names, these are only used for the end user s benefit. Ubuntu uses a numerical system to identify users and groups. These are referred to as user IDs (UIDs) and group IDs (GIDs), respectively. For various reasons, under Ubuntu, all the GID and UID numbers under 1000 are reserved for the system to use. This means that the first non-root user created on a system during installation will probably be given a UID of 1000. In addition, any new groups created after installation are numbered from 1000. On my system, the default user of keir had a UID of 1000 and a GID of 1000. The second user I added was given a UID of 1001 and a GID of 1001. Note UID and GID information isn t important during everyday use, and most commands used to administer users and file permissions understand the human-readable usernames. However, knowing UIDs and GUIDs can prove useful when you re undertaking more complicated system administration. Adding and Deleting Users and Groups The easiest and quickest way to add a new user or group is to use the Users and Groups tool under the System . Administration menu. Of course, you can also perform these tasks through the command line. Adding and Deleting Users via the GUI To add a new user, select System . Administration . Users and Groups and click Add User. You ll see the User Account Editor dialog box, as shown in Figure 30-1.

Web hosting bandwidth - 436 CHAPTER 30 MANAGING USERS Note As

Tuesday, March 18th, 2008

436 CHAPTER 30 MANAGING USERS Note As in real life, a group can have many members and can be based around various interests. In a business environment, this might mean that a group is created for members of the accounting department, for example, or for the human resources department. By changing the permissions on files created by the group members, each group can have files that only the group members can access (although, as always, anyone with superuser powers can access all files). On a default Ubuntu system with just a handful of users, the group concept might seem somewhat redundant. However, the concept of groups is fundamental to the way Ubuntu works and cannot be avoided. Even if you don t make use of groups, Ubuntu still requires your user account to be part of one. In addition to actual human users, the Ubuntu system has its own set of user and group accounts. Various programs that access hardware resources or particular sets of files normally use these. Setting up system users and groups in this way makes the system more secure and easier to administer. Root User On most Linux systems, the root user has power over the entire system. Root can examine any file and configure any piece of hardware. Root typically belongs to its own unique group, also called root. Ubuntu is different in that the root account is deactivated by default. Instead, certain users, including the one set up during installation, can borrow root-like powers by simply typing their login password. This is done by preceding commands with sudo at the command- line prompt, or as needed when using GUI programs that affect system settings. If you wish, you can activate the root user account on your system and then log in to it when necessary. To activate the root account, use the following command: sudo passwd root After typing your own login password, you ll be invited to define a password for the root user. Because of its power, the root user can cause a lot of accidental damage, so it s rare for anyone to log in as root on bootup. Instead, you can switch to root user temporarily from an ordinary user account by typing the following: su This will prompt you for the root password and then log you in as root for as long as you need. When you ve finished, type exit, and you ll be returned to your ordinary user account.

CHAPTER 30 Managing Users Linux (Web hosting support)

Monday, March 17th, 2008

CHAPTER 30 Managing Users Linux was designed from the ground up to be a multiuser system. When it is deployed on huge mainframe computers, it s capable of serving hundreds, if not thousands, of users at the same time, provided there are enough terminal computers for them to log in. In a more domestic setting, such as when Ubuntu is installed on a desktop PC, it usually means that more than one family member can have their very own account on the PC. Any files users create will be private, and users will also get their own desktop environment that is separate from that of the other users. And even if you re the only person using your PC, you can still take advantage of Ubuntu s multiuser capabilities. Consider creating user accounts for various aspects of your life perhaps one for work and one for time spent browsing the Web. Each user account can be tailored to a specific need. In this chapter, you ll learn how to administer multiple user accounts. Understanding User and Group Accounts The concept of users and file ownership was explained in Chapter 14, but let s take a moment to recap and elaborate on some important points. Users and Groups Each person who wishes to use Ubuntu must have a user account. This will define what that user can and cannot do on the system, with specific reference to files. Because Ubuntu is effectively one large file system, with even hardware devices seen as individual files (see Chapter 14), this means that user permissions lie at the heart of controlling the entire system. They can limit which user has access to which hardware and software, and therefore control access to various PC functions. Each user also belongs to a group. Groups have the same style of permissions as individual users. File access can be denied or granted to a user, depending on that person s group membership.

434 CHAPTER 29 (Web hosting provider) INSTALLING SOFTWARE Figure 29-8.

Monday, March 17th, 2008

434 CHAPTER 29 INSTALLING SOFTWARE Figure 29-8. Dillo in action a certain satisfaction comes from compiling a program from source code. Summary This chapter described how to install software under Ubuntu. We ve looked at how this differs from Windows software installation, and how the Debian package-management system is designed to make life easier. You learned how to use the Synaptic Package Manager to install software under the GUI, and how to use the dpkg and APT tools to install software at the command-line prompt. Finally, we looked at how programs can be compiled from their source code, which is a fundamental process of all versions of Linux. In the next chapter, we ll look at how to administer the system of users under Ubuntu.

Web site designers - CHAPTER 29 INSTALLING SOFTWARE The first command

Sunday, March 16th, 2008

CHAPTER 29 INSTALLING SOFTWARE The first command starts the configure script, created by the Dillo programmer, which checks your system to ensure that it meets Dillo s requirements. In other words, it checks to make sure the glib and GTK+ libraries are present. It also checks to make sure you have the correct software that s required to actually compile a program, such as GCC and make. It s when the configure script is running that something is most likely to go wrong. In that case, more often than not, the error message will tell you that you re missing a dependency, which you must then resolve. Note Some configure scripts are very thorough and check for components that the program you re trying to install might not even need. Because of this, you shouldn t worry if, as the text scrolls past, you see that various components are missing. Unless configure complains about it, it s not a problem. The next command, make, takes care of the actual program compilation. When it s run, the screen will fill with what might look like gibberish, but this is merely the output of the GNU compiler. It provides a lot of valuable information to those who know about such things, but you can largely ignore it. However, you should keep your eyes peeled for any error messages. It s possible that the configure script might not have checked your system thoroughly enough, and you might be missing an important system component; in which case, make will halt. Alternatively, the program simply might not be able to compile on your system without some tweaking to the makefile (the file that make uses). If such a situation arises, the best plan is to visit the web site of the developer of the software and see if there s a forum you can post to. Alternatively, check if the developer has an e-mail address you can contact to ask for help. Eventually, the compilation will stop with a number of exit messages. Then the final command must be run: make install. This needs to be run with superuser powers because its job is to copy the binary files you ve just created to the relevant system directories. In addition, any documentation that comes with the program is also copied to the relevant location on your system. Once the three commands have completed, you should be able to run the program by typing its name at the command prompt. If you ve been playing along at home and have compiled Dillo, you can run it by typing dillo, as you can see in Figure 29-8. Note Perhaps it goes without saying that you ll have to add your own icon to the desktop or Applications menu. Source packages are usually designed to be installed on any version of Unix running a variety of desktop managers. It s therefore impossible for the developer to know where to create desktop shortcuts.

432 CHAPTER 29 INSTALLING SOFTWARE First, you (Yahoo web hosting)

Saturday, March 15th, 2008

432 CHAPTER 29 INSTALLING SOFTWARE First, you see that Dillo needs the glib libraries. This is a given on nearly all Linux systems, but in order to compile, Dillo will need the devel version of glib, which isn t part of the default Ubuntu installation. Next, you read that it also needs the GTK+ 1.2 libraries. These are present on the majority of GNOME-based Linux desktop systems but, once again, the devel versions will need to be installed. Beneath that in Dillo s list of requirements is support for JPEG and PNG image formats, which are definitely installed on the average Linux system, and the WGET download tool, which is also included with most versions of Linux (although it s a good idea to use the Synaptic Package Manager or apt-cache search to check that it s installed). After finding out about dependencies, you should scroll down the README to look for any notes about compiling under Linux. It turns out there might be some issues with older 2.4 versions of the Linux kernel, but Ubuntu uses 2.6, so this isn t an issue. So, in short, before you can compile Dillo, you need to install devel versions of the glib and GTK+ 1.2 libraries. You can install these via the Synaptic Package Manager or apt-get. It will help cut down the search results if you realize that system library packages under Ubuntu are usually prefaced with lib. So, search for the devel versions of libgtk and libglib. Doing so on my test system returned three likely packages: libglib1.2-dev, libglib2.0-dev, and libgtk1.2-dev. There are two libglib entries because my system has both glib2 and the older glib1.2. To ensure compatibility, I decided to install develversions of both. Since you re working at the command prompt, install the packages via apt-get: sudo apt-get install libglib1.2-dev libglib2.0-dev libgtk1.2-dev As soon as I typed this, it turned out that libgtk1.2-dev came with a host of dependencies in the form of X server devel libraries. The reasoning is that if the GTK+ devel library files are needed, these other libraries are often needed, too. Whatever the case, there s no harm in installing them. Compiling Now comes the exciting process of compiling the program! This is done via three commands, issued in sequence: ./configure make sudo make install

CHAPTER 29 INSTALLING SOFTWARE if the software (Free web hosts)

Saturday, March 15th, 2008

CHAPTER 29 INSTALLING SOFTWARE if the software relies on certain library files, you ll need to install developer (devel) versions of them, as well as the libraries themselves if they re not already installed. For example, if you re compiling a program to run under the GNOME desktop, you ll need development versions of the GTK2+ libraries. Under Ubuntu, it s possible to install all the program-compilation tools you need by installing the build-essentialmetapackage. You can use the Synaptic Package Manager or the following apt-getcommand at the command prompt: sudo apt-get build-essential On my test system, most of these files were read from the installation CD, rather than downloaded, so you ll either have to have the CD present or remove its entry in your list of repositories in order to force APT to get the packages online. Unpacking the Tarball and Solving Dependencies Let s take a look at installing a program from source. Dillo is a stripped-down web browser that s designed for speed and small file size. It s a fun little program that s good to have around in the event of your main browser developing a glitch that you can t fix. The Dillo home page is www.dillo.org, so head over there and choose to download the latest version of the source code. Note Okay, you got me. If you use apt-cache or the Synaptic Package Manager to look through the repositories, you ll see that Dillo is available as a ready-to-install package. But Ubuntu s package repositories are so comprehensive that, frankly, I couldn t find anything to demonstrate program compilation that wasn t already in there! The first thing to do is to unpack and uncompress the tarball (if you wish to learn more about the tar command, see Chapter 32): tar jxf dillo-0.8.5.tar.bz2 Of course, you should replace the filename with that of the version you downloaded. Next, you ll need to switch into the source code directory and take a look at the README file. This will tell you what dependencies Dillo has and also any caveats you may need to take into account in order to compile Dillo on a Linux system: cd dillo-0.8.5 less README Note Unlike binary files, source code is rarely designed with one specific computer platform in mind. For example, Dillo is able to compile on all types of Unix, including Linux, Solaris, BSD, and others. With a little work, it might even be possible to compile it under Windows!