Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


November 2004

A Linux Primer for Windows Administrators

Clueless about Linux? This guide to the essentials can help you get your bearings
RSS
Subscribe to Windows IT Pro | See More Linux Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
SideBar    Linux's Online Help, IT Saves the Data Center with VMs

Windows and Linux may be rivals in the marketplace, but in the data center they're more likely to coexist as complementary platforms. If you haven't yet encountered Linux in your career as a Windows administrator, you need to prepare for that eventuality by acquiring a basic understanding of Linux administration. This article jump-starts your Linux learning by explaining essential concepts of Linux user administration, file systems, networking, and software management. (To learn how to obtain more information about Linux commands, files, and programs, see the sidebar "Linux's Online Help," page 43, and the Learning Path box, page 45.) Although the topics I discuss pertain to all Linux distributions, the examples I provide are based on Red Hat Enterprise Server 3—RHES—and might not work for the Linux distribution that you use. Be sure to read your vendor documentation to obtain the correct commands and syntax for your Linux distribution.

Getting Started
Before we go further, let's get a few of the basics out of the way. Linux, like Windows, uses the concept of users and groups for authentication and authorization to resources. Each user must be a member of at least one group, and users can additionally be members of other groups. I discuss user and group administration in more detail later.

Like FAT and NTFS, the Linux file system is organized as a tree—meaning that the file system has a root directory and subdirectories under it. In Linux, the root directory is represented simply by a forward slash (/), whereas in Windows, the root directory is represented by a drive letter and a backslash (e.g., C:\); Linux uses the forward slash instead of the backslash as directory separator. Unlike Windows, Linux doesn't have separate drives; all directories and mounted file systems (e.g., D: in Windows) are found at or under the root directory in Linux. (I explain the concept of mounting a bit later.) Finally, you'll notice that the sample commands I provide begin with the hash character (#)—the Linux shell prompt, which is analogous to using "C:\" to begin a command example. Now let's delve into the specifics of real-world Linux administration.

User Administration
User administration in Linux is conceptually the same as Windows user administration. You define users and groups of users, configure their accounts, and specify their access rights. However, Linux provides administrative tools that are very different from those found on Windows systems. You use these tools to create, delete, and modify user accounts and user groups.

You define a user account by creating an entry in the /etc/passwd file; Table 1 shows the file's contents. By definition, any entry in the /etc/passwd file is a user account, even if it isn't active. As in Windows, software that you install under Linux might create additional user accounts. Each entry in /etc/passwd includes several fields, such as username, password, and home- directory. Here's a sample /etc/passwd entry:

dpuryear:x:500:500:Dustin Puryear:/home/dpuryear:/bin/bash

This entry specifies that the user, dpuryear, has a user ID of 500 and defaults to the group 500 (coincidentally, the same as the username), has the full name Dustin Puryear, is assigned to the home directory /home/dpuryear, and uses /bin/bash (Bourne Again Shell) as the logon shell. The user ID has the same function in Linux that the SID does in Windows. And in Windows, the command shell is cmd.exe; in Linux, the shell is typically /bin/bash.

You'll notice that the second field—the password field—contains an x. In our example, the Linux system uses shadow passwords (provided by the shadow-utils package, which is used on all modern Linux systems), which means that all passwords are actually in the file /etc/shadow. Linux uses the x merely as a placeholder; it doesn't represent a true password. (Actually, the true password isn't stored anywhere in the system. Instead, a hashed version of the password is stored, just as in Windows.)

To create a new user account, you run the adduser command (useradd on some systems) from the bash shell as the root user. Adduser creates a user entry and, if specified, a home directory in the /etc/passwd file. The syntax for adduser is

adduser username -option

where -option represents a command option, such as -u (user ID), -g (group), -d (home), or -s (shell). For example, to create a new account named jdoe for the employee John Doe, enter the command

# adduser jdoe

which creates the following entry in /etc/passwd:

jdoe:x:600:600::/home/jdoe:/bin/bash

You can specify options on the adduser command, for example:

# adduser jdoe -c "John Doe" -m

This command creates an entry in /etc/passwd for the user jdoe; the −c option sets the user's real name to "John Doe," and the -m option creates a home directory for jdoe. In Linux, you have to specify −m or the system won't create the home directory, and the home directory defaults to /home/username unless overridden with the −d option, which lets you specify a different location for the home directory. (On Windows systems, the home directory is created when the user first logs on.)

Unlike Windows, Linux doesn't prompt you for a password when you add a new user account. Instead, you must use a different command—/usr/bin/passwd—to specify an initial password for the user, like this:

# /usr/bin/passwd jdoe

After you enter the command, you'll see onscreen messages and prompts similar to these:

Changing password for user jdoe.
New password: password
Retype new password: password
passwd: all authentication tokens
updated successfully.

To delete an account, you use the userdel (user delete) command, like this:

# userdel jdoe

By default, userdel doesn't remove a user's home directory even when the user's account has been deleted. To remove a user's home directory, you must specify the -r (remove) option on the userdel command:

# userdel jdoe -r

As a Windows administrator, you're probably wondering how you manage users for an entire network when you have to manually add users on each Linux server. The solution is to use a UNIX or Linux network user-management system such as Network Information Service (NIS) or perhaps use Active Directory (AD) for authentication.

Using AD in Linux is typically accomplished by running either the open-source Samba software or Windows Services for UNIX (SFU). Samba provides the Winbind application, which essentially turns Linux into a domain member, complete with authentication and authorization against AD. SFU provides a NIS interface to an AD network.

As you've seen, I use command-line examples. Linux—and UNIX in general—can be completely administered from the command line. All Linux distributions also include GUI-based administration tools, but it's useful to be aware of the underlying command-line tools that the GUI applications rely on. For example, you might want to write a script that uses such commands to manage a large number of user accounts.

   Previous  [1]  2  3  Next 


Reader Comments
Great article! But as a Linux enthusiast, I have to take offense at the comment that RPMs are “the closest thing to a true package stand” in the Linux world. You didn’t even mention Debian’s apt or Gentoo’s emerge. Both of these systems have revolutionized the way Linux users get software. You simply type in the package name and the software takes care of downloading and installing not only the package you requested, but any dependencies packages as well. Try that with Red Hat OR Windows. Think of it like an Add/Remove Programs with every piece of software in the world on the available list. And both these distros seem to have every package I want available, so who cares about a standard. If you do though, Debian’s Alien package will convert .rpm’s to .deb’s.

Anonymous User October 29, 2004


Thanks for the compliment.

You are correct that RPM is not the only standard, but it is indeed the most used standard. As far as ease-of-use, RPM does fall short of other methods used by Debian or Gentoo's Portage (or, indeed, of BSD's ports). With the right add-on tools RPM can emulate the same functionality.

As far as caring about standards, well, a lot of people do. :)

- Dustin


dpuryear November 01, 2004 (Article Rating: )


Great article. I'm learning more about the LINUX command line interface these days because of the RedHat 7.2 Service Console for VMware ESX Server that is hosting my Windows Virtual Machines.

I like the comparisson of the Windows tools to the equivalent Linux tools. I look forward to more articles like this although I know this isn't a LINUX IT PRO Magazine. ;)

Thanks again...

GWM November 11, 2004 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Interact! Interoperability Zone Forum

Learning Path Give Linux desktops access to Microsoft Exchange Server:
"“Providing Exchange Server Access to Linux Desktop Computers”"


Learn about advanced Linux systems management techniques:
"Best Practices for Managing Linux and UNIX Servers (eBook)"


Learn about Windows Services for UNIX (SFU) and Network Information Service (NIS)
"“Microsoft Windows NT Services for UNIX”"


Use one ID to access Windows and Linux systems:
"“Centralized Authentication for Windows & Linux”"


Online Linux Help sites
"Alphabetical Directory of Linux Commands"


Top Viewed ArticlesView all articles
PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Speed Up Your PC!
Try Diskeeper 2008 with InvisiTasking Free Now!

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Agent-less Remote Backup Service, Free 30 Day Trial
Award winning remote backup service at a competitive price with no min GB/month. Sign up Now!

ScriptLogic Cartoon Caption Contest
Submit your caption and you will be entered to win $198.42

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

List Your Products in Our Technology Resource Directory
Don't miss the chance to post your free listing in this comprehensive directory for IT and developer professionals, powered by Windows IT Pro. But hurry! Deadline ends Oct. 9.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing