Sei sulla pagina 1di 95

TRANSITIONING FROM WINDOWS

TO LINUX ADMINISTRATION:
A GUIDE FOR NEWCOMERS

Written by Scott Matteson


November 2014

Copyright ©2014 CBS Interactive Inc. All rights reserved.


Transitioning from Windows Credits
to Linux Administration: Global Editor in Chief
A guide for newcomers Jason Hiner

Copyright ©2014 by CBS Interactive Inc. All rights reserved. Editor in Chief, UK
Steve Ranger
Tech Pro Research and its logo are trademarks of CBS Interactive Inc.
Managing Editor
All other product names or services identified throughout this book are Bill Detwiler

trademarks or registered trademarks of their respective companies Editor, Australia


Chris Duckett
Published by
Tech Pro Research November 2014 Senior Editors
Jody Gilbert
Disclaimer Mary Weilage
Sonja Thompson
Teena Hammond
The information contained herein has been obtained from sources

believed to be reliable. CBS Interactive Inc. disclaims all warranties


Chief Reporter
Nick Heath
as to the accuracy, completeness, or adequacy of such information.
Staff Writers
CBS Interactive Inc. shall have no liability for errors, omissions, Lyndsey Gilpin
Conner Forrest
or inadequacies in the information contained herein or for the
Erin Carson
interpretations thereof. The reader assumes sole responsibility for
Graphic Designer
the selection of these materials to achieve its intended results. The Lorraine Vogel

opinions expressed herein are subject to change without notice.

Tech Pro Research


9920 Corporate Campus Drive
Suite 100
Louisville, KY 40223
http://techproresearch.com
Visit: Site Help & Feedback

Tech Pro Research is a ZDNet Web site.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


CONTENTS
Introduction———————————————————————————————————————— 04
Part I ———————————————————————————————————————————— 04
Similarities between Windows and Linux————————————————————————— 06
Differences between Windows and Linux ———————————————————————— 07
Getting Oriented to Linux —————————————————————————————————— 08
1. Creating and managing user accounts, passwords and groups—————————— 10
2. Working with files, directories and permissions ——————————————————— 17
3. Granting administrative privileges ——————————————————————————— 24
Part II ———————————————————————————————————————————— 27
1. Installing programs/services and setting startup processes———————————— 28
Installing programs————————————————————————————————————— 28
Setting up a repository—————————————————————————————————— 36
To set up a repository of packages from the Red Hat Enterprise Linux DVD———— 36
Working with packages—————————————————————————————————— 38
To set up a repository of packages from an internet site———————————————— 44
Working with startup processes ————————————————————————————— 49
2. Managing running processes—————————————————————————————— 55
3. Working with user environments———————————————————————————— 58
Part III———————————————————————————————————————————— 64
1. Formatting drives/partitions——————————————————————————————— 65
2. Mounting devices/configuring, accessing and sharing network resources——— 74
Connecting to other Linux systems————————————————————————————— 77
How are directories set up for remote access?—————————————————————— 78
3. Working with shell scripts———————————————————————————————— 83
4. Troubleshooting/checking logs————————————————————————————— 89
5. Useful Linux command-line tricks——————————————————————————— 92
6. Getting free help/resources for further information————————————————— 94
Conclusion————————————————————————————————————————— 95

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
4

Introduction
Windows and Linux are operating systems with many similarities and differences. Learn some tips to help cross the
bridge between the two in a three-part series, Transitioning from Windows to Linux Administration: A guide for new-
comers. This series was originally published on Tech Pro Research and is now available in a downloadable guide that
compiles all three articles into an easy-to-read and downloadable format.

Part I
The “Mac vs. PC” television ads from several years back were entertaining but not necessarily accurate depictions of
the mindset behind Apple and Windows users. In truth neither users
nor administrators of any particular operating system can be
easily categorized or pigeonholed. Apple computers aren’t
necessarily wielded exclusively by glamorous “go against the grain” “... it is a fact that all
hipsters nor are Windows systems relied upon by stodgy corporate
operating systems have
heads.
an array of similarities and
However, it is a fact that all operating systems have an array of
similarities and differences between them. While the similarities differences between them.”
can provide universal standards to help orient new users and
administrators, the differences can make them daunting to learn.
This is exemplified by the gap between Windows and Linux admin-
istration. Windows administrators have always had more than enough tasks on their plates and finding the free time to
spend dabbling with other operating systems can be a difficult. Windows has held a dominant place in the enterprise
for decades, but that doesn’t guarantee the future, and there is plenty of room at the expanding table of business
technology. While Linux usage remains low on the desktop, it runs on over one third of web servers and a whopping
96.4% of supercomputers, according to Wikipedia.

Let’s look at the history of Linux for a moment. Linux is an open source operating system which is basically a derivative
of UNIX. Invented by Linux Torvalds in 1991, many versions (known as “distributions”) are available both for free and via
commercial means. Linux runs on desktops, servers, mobile devices and other hardware.

Linux momentum has grown steadily since 1991, accelerating even further as of late. A ZDNet article from February of
2014 states that “77 percent of hiring managers have ‘hiring Linux talent’ on their list of priorities for 2014” and “more
than nine out of ten hiring managers plan to bring Linux professionals on board in the next six months.” The Linux
Foundation released an “2013 Enterprise End User Report” claiming five year plans for increased OS investments
demonstrate an 80% increase in the use of Linux whereas an increase of only 20% in the Windows segment.
Readwrite.com goes so far as to encourage: “Keep Learning Linux — It’s the Future.”

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
5
Some of the reasons behind the advance of Linux include a proven track record in corporate server environments,
reliability and security, appearance in various popular platforms such as on Android devices, and the increased use
of cloud computing. The cloud has helped reduce desktop application complexity by replacing many traditional
Windows programs with a web browser, thereby making the operating system easier to replace with free open-source
alternatives.

The purpose of this article isn’t to state Linux is better than Windows, but rather to emphasize it is a growing field with
tremendous opportunity for businesses seeking to deploy it and system administrators who want to learn more about
it. It can be a challenge for newcomers since Linux is generally perceived as extremely complex, but keep in mind that
“complex” also means “powerful.” There are many different ways to perform different functions in Linux from simple
manual tasks to intricate automated scripts. Whether you’re starting down the path of Linux administration or would
like to learn more about the topic from a Windows perspective, this guide can help orient you.

Prerequisites for users of this guide are familiarity with concepts of system administration such as creating users,
working with permissions, managing programs and processes, configuring hardware such as network details and hard
drives and reviewing event logs for errors.

There are many Linux distributions such as Red Hat, Fedora, Debian, and Ubuntu. These tips and screenshots are
based on Red Hat Linux administration, since that is generally the corporate standard, but should also work on most
if not all other Linux flavors.

In order to get started, let’s compare the similarities as well as differences between Windows and Linux.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
6

Similarities between Windows and Linux


Configurable boot up sequence/device drivers/startup programs/services.

User and administrator accounts (administrator on Windows / root on Linux) are needed.

Files work the same; some are data, some are executable programs, others represent settings.

Directories are used to store files.

User profile environments set parameters for how accounts operate.

Applications are installed/run/removed.

Either can work as file, application, web, DNS, DHCP, or print servers.

Certain infrastructural underpinnings like file systems and network protocols (TCPIP) and services
(DNS, DHCP, NTP) apply for each.

Scheduled tasks/scripts are run on both operating systems.

It’s easy to see what’s running and stop unwanted processes.

Command line knowledge isn’t required for either, but it definitely helps — especially with Linux!

Files can be transferred or shared between systems.

Viruses can infect each operating system (but the bulk of these are geared towards Windows).

System lockups or crashes can occur.

Patching is required for best security practices.

Some administrative tasks can be exceedingly difficult — Microsoft’s Configuration. Manager (also referred to
as SCCM) can be difficult to maintain and administer, but the same applies for a similar Linux product called
Puppet.

Each has a strong technology culture behind it with enthusiasts in both camps (contrary to myths that
Windows is for regular people/Linux is for the analytically-included).

Both Windows and Red Hat Enterprise Linux cost money (though many other Linux blends are free of charge,
particularly the desktop versions).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
7

Differences between Windows and Linux


Windows is proprietary meaning the source code is unavailable to the public or the user. Linux is open source
meaning the code can be accessible by anyone.

The graphic user interface (GUI) is not the same; the Linux GUI is more of a shell whereas Windows provides a
richer GUI with more administrative capabilities than Linux.

Linux offers different GUIs such as Gnome or KDE, but these can look a bit dated — not as “flashy” or
polished as Windows.

Windows uses letters to represent local or network drives (which are “mapped”). There is no C: drive (nor any
other letter) in Linux, which groups drives and directories in a single hierarchical structure (“/” for the root
directory, “/home” for user home folders, “/mnt” for local/remote file systems, etc.)

Windows uses the registry to store system/application/user information. Linux does not, relying instead on
configuration files.

Linux doesn’t always use file extensions.

Windows denotes executable files with certain extensions such as .exe, .bat and .com. Linux marks files as
executable both via the extension and the permissions, meaning any file can be executed.

Windows files are not case sensitive; Linux files are (meaning Linux.conf is a different file from linux.conf and
you need to refer to it with the appropriate case)

Linux doesn’t directly use Active Directory or Group Policies but authentication can be tied into AD using
Lightweight Directory Access Protocol (LDAP).

Linux is more stable and less prone to odd lockups, freezes and delays — not immune, but often provides
better performance than Windows.

Linux has a long history of traditional commands; Windows changes more frequently as new developments
such as Powershell come about.

Linux rebuilds are less frequent since the OS has less of a tendency to get “tangled up.”

It can be more challenging to resolve Linux issues — online forums might help but any advice provided may
depend on advanced knowledge by the user/administrator.

Some administrative tasks which are easy in Windows (formatting drives, configuring settings, reviewing error
logs) can be more difficult in Linux.

Games are better on Windows (but this is not much of an issue in most business environments except game
manufacturers).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
8

Getting oriented to Linux


The best way to get more familiar with Linux is by examining some of the above similarities and differences to
see what’s involved, then try out the concepts in this guide using a test environment (do not experiment on a live
production environment, as this could have disastrous results). It is recommended that you obtain a copy of Linux
and install it to run through these commands and functions. A good example is Scientific Linux, a Red Hat derivative,
available at http://www.scientificlinux.org.

To reiterate, Linux administration doesn’t require exclusive use of the command line — and in fact there are many
GUI tools to further help you get things done in Linux such as installing and running programs, managing users,
obtaining and setting network details, searching for files, working with drives and partitions, managing processes
and files, reviewing system logs and more. Linux offers different GUI environments such as GNOME and KDE,
which allow users to set up and customize their environments and perform tasks using the mouse. However, it’s
also important to know how and why certain things work from the ground up to understand Linux methods as they
compare to Windows.

A note about the command line: Linux can be more demanding than Windows in terms of requiring absolutely perfect
syntax when interpreting commands. Spacing, dashes and slashes are routine elements of a properly executed
command line function. You can always type “man [command]” (e.g. man ls to examine the details and switches used
when running the Linux equivalent of “dir”) to get help on how a command runs, or browse the web for examples if
you find yourself stuck with errors. It is also recommended that you research and fully test all commands shown here
for further details and functionality.

This entirety of this guide will focus on the following introductory Linux concepts:

Creating and managing user accounts, passwords and groups

Working with files, directories and permissions

Granting administrative privileges

Installing programs/services and setting startup processes

Managing running processes

Working with user environments

Formatting drives/partitions

Mounting devices/configuring, accessing and sharing network resources

Working with shell scripts

Troubleshooting/checking logs

Useful Linux command-line tricks


Getting free help/resources for further information

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
9
These concepts have been split up into separate articles to make the learning process more digestible.

The Linux installation process is not covered, mainly because it’s a simple and straightforward procedure (which has
come a long way; it is now quite similar to the Windows installation experience) and specific documentation is usually
provided with the installation media that can help you complete this task if needed.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
10

1. Creating and managing user accounts, passwords


and groups
To create accounts you’ll need to log in as the root (administrator) account or use the “su root -” (substitute user)
command while logged in with an existing account then enter the root password to work with elevated privileges (see
#3 for further details). If you’ve built a test system to experiment with Linux, chances are your first login will be as root.

Once you have root access creating user accounts is as simple as typing:
useradd [account]

The account will be created. You’ll want to set a password too, of course. Enter:
passwd [account]

You will be prompted to enter the password twice, after which it will be assigned to the account.

What if you want to set the account to be disabled after a certain date?
Run useradd -e [date account should expire] [account]

For instance this command will create a user account called “smatteso” which will expire after June 30, 2014:
useradd —e 2014-06-30 smatteso

To lock an account (such as when a user has departed the company) enter:
passwd —l [account]

To unlock an account use:


passwd —u [account]

To view account status for a user:


passwd —S [account]

For instance this yields:


smatteso PS 2014-05-29 1 60 7 -1 (Password set, MD5 crypt.)

“PS 2014-05-29” refers to when the password was last set.

“1” shows the minimum number of days that must pass before the password can be changed.

“60” shows the maximum password age in days

“7” shows the number of days before password expiry during which the system will remind a user of the
upcoming expiration.

“-1” specifies the maximum number of days an account can remain unused; in this case it means it will remain
valid indefinitely.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
11
User account information is stored in a file called /etc/passwd. You can view the file by typing:
cat /etc/passwd

Figure A

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
12
Seven fields are shown for each user account. Using the smatteso account as an example, here is what these fields
represent:
smatteso:x:501:501::/home/smatteso:/bin/bash

“smatteso” is the username.

“x” indicates that an encrypted password is stored in a file called /etc/shadow (which contains passwords
in an unreadable format)

The first “501” represents the user ID; a unique value similar to a Windows security identifier or “SID.”

The second “501” represents the primary group ID for the user.

“home/smatteso” signifies the user home directory (similar to Windows, every user generally has one)

The “::” section is a comment field which is blank; information about the user could be entered here.
In the case of the “admin” account shown above “smatteso” the comment reads “RHEL 6.”

“/bin/bash” is the location of the user’s shell or the command processor (more on that later in this guide)

Groups are used to provide access privileges for large sets of users. These are stored in the /etc/group file. You can
view the file with the “cat” command (which lists file contents) by typing:
cat /etc/group

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
13

Figure B

Figure G
Copyright ©2014 CBS Interactive Inc. All rights reserved.
TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
14
This file shows all groups and their members. It is a bit less complex than /etc/passwd and works in a similar fashion.
In the example of the “wheel” group you will see:
wheel:x:10:smatteso

“wheel” is the group name.

“x” indicates that an encrypted password is stored in the /etc/shadow file

“10” is the group ID.

“smatteso” represents the user in the wheel group; if there were multiple users these would appear here.

A simple way to find out which groups a user belongs to would be to enter:
groups [accountname]

You can use “groupadd” to create groups, “groupmod” to modify groups, “gpasswd” to add or remove members to
groups and “groupdel” to delete groups.

To create a new group called accounting use:


groupadd accounting

To rename the accounting group to finance use:


groupmod accounting —n finance

To add the user smatteso to the finance group:


gpasswd —a smatteso finance

(note if you run this multiple times it will not prompt you the user already exists in the group)

To remove the user smatteso from the finance group:


gpasswd —d smatteso finance

To delete the finance group use;


groupdel finance

You can edit the /etc/passwd and /etc/group files directly to speed up your system administration. This involves using
the Vi text editor in Linux to safely edit these files. Use “vipw” for /etc/passwd and “vigr” for /etc/groups.

Number of respondents, n=251


Copyright ©2014 CBS Interactive Inc. All rights reserved.
Figure H
TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
15
Here’s what vipw will do:

Figure C

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
16
Vi can be a bit tricky to learn because it is not quite as user-friendly as the Windows Notepad application, but there
are plenty of useful guides online to help get you oriented. For the purpose of this step all you need to do is hit the
“INSERT” key when the file opens to turn on editing mode. You can then use the arrow keys to scroll to any part of
the file and add/delete characters as needed. For instance, if you wanted to rename “smatteso” to “smatt” or create
a similar user (remember to set a different user account name and ID) you could do so.

Hit the Esc key to exit editing mode when you are done, then type “:wq!” to save and exit the file. Note: if something
goes wrong and you just want to exit the file without saving, press Esc then q! to exit.

The same principle works when using “vigr” to access the /etc/group file.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
17

2. Working with files, directories and permissions


In order to understand how files, directories and permissions work you have to review the base directory structure on a
Linux system. Whereas a Windows server may have folders such as C:\Users, C:\ProgramData and C:\Windows, Linux
organizes directories on the filesystem in the following way, with every folder preceded by a “/” or forward slash:

Directory Description
/ The root directory or lowest point of the directory tree
/bin Programs needed for the boot process
/dev Device files for hardware components
/etc Important system configuration files (lots of interesting items in here)
/etc/init.d Boot scripts that determine what runs when the system starts
/home User home folders
/media, /mnt Used for mount points where different physical devices can be attached
/opt Optional software, larger add-on programs
/proc Process file system
/sbin Programs needed for the administrator
/sys System file system where all device information for the kernel is gathered
/tmp, /var/tmp Temporary files (nothing saved here is kept)
/usr, /usr/local All applications and local extensions (/usr/local)
/usr/bin, /usr/sbin Accessible programs (/usr/bin)/those reserved for the system administrator ( /usr/sbin)
/usr/share/doc Documentation files
/var/log System log files

Directories on different partitions or physical disks may be included here, so unlike the C: and D: drives on many
Windows servers this is an all-inclusive view.

Navigating through directories is the same as in Windows; use the “cd” command. For instance, “cd /etc” will take you
to the /etc folder. “cd ..” will take you down a folder level; back to the root level for instance. Folders are created and
removed with the “mkdir [folder name]” and “rmdir [folder name]” commands (necessary permissions required, of
course).

Use the “ls” command to list files and directories the same way “dir” works in Windows. You can use wildcards to look
for certain files. For instance, this command will look for all files ending with “.conf”:
ls *.conf*

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
18
Running “ls —l” will show you output in a “long listing format” similar to the following:

Figure D

Remember, Linux files are case sensitive — if you want to edit the X11 file you can’t refer to it as “x11” since the
upper-case X is used.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
19
Note the information to the left of the file names — much of this detail signifies permissions and owners. Let’s use
syslog.conf as an example.

-rwxr-xr-x 1 root root 1460 Nov 3 2011 syslog.conf

The first 10 characters signify the following:

Character(s) Explanation
1 (-) Whether the object is a file (-) or directory (d)
2-4 (rwx) Owner permissions on the file
5-7 (r-x) Group permissions on the file
8-10 (r-x) All user permissions on the file

Permissions are signified by r (read), w (write) and x (execute).

The “1” to the left of “root root” represents the number of hard links (aliases) to the file.

“root root” signifies that “root” is the owner and that the “root” group has permissions on the file. So for syslog.
conf the “root” user has read, write and execute (rwx) permissions, the “root” group has read and execute (rx)
permissions, and all other users have read and execute (rx) permissions.

“1460” denotes the file size in bytes.

“Nov 3 2011” refers to the date the file was last saved.

How can you set and remove permissions for the owner, group and all users? Use the chmod command. “Chmod +”
will add permissions and “chmod —“ will take them away, based on the following permission groups:
u – Owner
g – Group
o or a – All Users (it’s preferable to use “a” since it’s more intuitive, as it stands for “all”)

Again, the permissions that are used are:

r – Read
w – Write
x – Execute

If you wanted to add “write” permissions to syslog.conf for the group owning it you would use:

chmod g+w syslog.conf

(whereby “g” represents “Group.”)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
20
The permissions would then appear as shown when you run ls —l and look for syslog.conf:

rwxrwxr-x

The same chmod principle applies for u (owner) / o or a (all users); just substitute “u” or “a” for “g.” For example,
to grant executable access to the user who owns the file:
Chmod u+x syslog.conf

To remove the permissions granted by the above commands type:

chmod g-w syslog.conf

chmod u-x syslog.conf

Chmod can also be applied using a combination of number-based permissions for deeper granularity and control.

How about setting the owner or group on a file? You would use the “chown” command for that.
chown [account] [filename]

For instance to grant the user smatteso ownership on syslog.conf you would run:
chown smatteso syslog.conf

The same applies to a group, using the addition of a colon before the group name:
chown :[group] [filename]

For example, chown :root syslog.conf would then set the root group as owning the file.

How about copying the owner/group settings from an existing file? Easy — use the following:
chown --reference=[sourcefile] [targetfile]

If you wanted to use a file in /etc called filelog as the source and our sample syslog.conf file as the target the command
would appear as shown (you must specify the path to the target file if you are not in the same directory in which it
appears):
chown —reference=/etc/filelog syslog.conf

How can you set owner/group on all files in a subdirectory? Use chown with the —R (recursive) switch to expand its
scope:
chown -R smatteso:root etc/

Obviously these commands can do great damage if misused, so proceed with caution; this is why it makes sense to
run them in a test environment to build experience with them!

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
21
You may have noticed that the permission capabilities seem a bit limited in Linux so far. In Windows you can provide
various types of access to numerous users and groups, such as providing Bob with read-only access, Accounting
with read-write access and HR with read-only access. Linux allows similar functionality via the use of the “getfacl”
and “setfacl” commands, which will display and set access control list (ACL) permissions.

Let’s say a file called “Trolltech.conf” needs multiple ACL permissions assigned. You can run “getfacl Trolltech.conf” in
the directory in which the file is located (or specify it in the path, such as “getfacl /etc/Trolltech.conf”) A permission list
similar to the following is shown:

Figure E

In this case no special permissions are assigned; the owner and group are both root.
Setfacl can be used to apply specific read, write and execute permissions (r/w/x) for users and groups using the “-m”
switch. If you wanted to provide smatteso with read access to Trolltech. conf you would type:

setfacl —m u:smatteso:r Trolltech.conf

“-m” adds the permission.

“u:smatteso” signifies you are granting access to a user (u) — groups would be represented with a “g”.

“smatteso:r” means that smatteso is receiving “read” permissions.

To assign the accounting group read and write permissions to the file type:

setfacl —m g:accounting:rw Trolltech.conf

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
22
The screenshot below shows the command applied, then the “getfacl Trolltech.conf” command run to verify the ACL
change:

Figure F

As you can see, the accounting group now shows “rw” permissions.

To remove permissions, use the “-x” switch. If you wanted to remove access for the user smatteso you would run:
setfacl -x u:smatteso Trolltech.conf

Running getfacl Trolltech.conf shows the permission has been removed:

Figure G

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
23
Just like with copying the owner/group settings for a file, you can copy file permissions as well. Use the command:
getfacl file1 | setfacl --set-file=- file2

To copy the permissions from Trolltech.conf to a file called testfile.conf use this string:
getfacl Trolltech.conf | setfacl --set-file=- testfile.conf

You can use getfacl and setfacl on folders in the same way. As in Windows, folder permissions “trickle down” so that
having access to a folder allows a user to have access to all the subfolders and files contained therein. To use setfacl
to provide access on a folder and all of its contents the —R recursive switch comes into play. Let’s say you want to
grant rw permissions to the “testfolder” directory for the accounting group. Run:
setfacl -Rm g:accounting:rw testfolder

That “—Rm” means to apply the permission recursively.

To remove the permission, use the “x” switch:


Setfacl —Rx g:accounting testfolder

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
24

3. Granting administrative privileges


Now that you’re familiar with setting up user accounts and granting permissions, it is recommended that you use a
standard account rather than root to conduct further exercises and testing. The reason for this is that, just like running
as Administrator in Windows, it’s not secure to work as root except on a temporary basis. As with Windows, Linux has
a “run as administrator” function to let users perform certain tasks with elevated root account rights. This involves a
command called “su” which stands for “substitute user”:
su root —

You will be prompted for the root password. After typing it in you’ll be working as root. Type “exit” when done to return
to your normal account.

What if you want others to be able to run commands as root without actually having to provide them with the root
password? That’s where the sudoers file comes in. This file allows you to permit users to operate as root. Located
at /etc/sudoers, you can edit it directly using the command “visudo,” which opens it within the Vi terminal editor,
as shown with “vipw” and “vigr.”

Figure H

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
25
Scroll down near the bottom and look for the “Allow root to run any commands anywhere” section:

Figure I

In the example above I’ve added this line under the “root” entry (tabs are used between the sections):
“smatteso ALL=(ALL) ALL”

“smatteso” represents the account

The first “ALL” signifies which terminal (workstation name) the user can run sudo from.

The second “ALL” represents the account(s) the user can run sudo as (you can use other accounts
besides root).

The third “ALL” demonstrates which commands the user may run sudo as (make sure to specify the full path
to the commands).

Therefore, you can enforce powerful controls for users to whom you wish to grant sudo access; you can restrict them
to a single workstation, a single user, and even a single command. If you want to include multiple entries for each
category just separate them with a comma. For instance, this would restrict the user to only be able to run the “/usr/
bin/apt-get*” and “/etc/init.d/apache2 restart” commands:
smatteso ALL=(ALL) /usr/bin/apt-get*, /etc/init.d/apache2 restart

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
26
You can also use the “NOPASSWD: ALL” option (under the “Same thing without a password” section) so the user
won’t be prompted for their password when switching to root access:
“smatteso ALL=(ALL) NOPASSWD: ALL”

Hit the Esc key to exit editing mode when done, then type “:wq!” to save and exit the file.

Note: if something goes wrong and you just want to exit the file without saving, press Esc then q! to exit.

Now when this user needs to run commands as root, they can simply type “sudo —s” to switch to root access, with
or without a password prompt depending on your configuration. Once again, they should type “exit” when done to
resume working under their standard user credentials.

Typing “whoami” will return your current account name, which helps to avoid confusion if you’re not sure who you are!

This covers the first three sections of the guide. Part II will continue the series.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
27

Part II
In the first installment of this series we took a look at the history of Linux and how it has grown into an essential force
in many enterprise data centers. We also discussed some of the ways in which Windows and Linux are both similar
and different, with the goal of helping to orient new Linux administrators with a background in Windows operations.

The entirety of this series will focus on the following introductory Linux concepts:

Creating and managing user accounts, passwords and groups

Working with files, directories and permissions

Granting administrative privileges

Installing programs/services and setting startup processes

Managing running processes

Working with user environments

Formatting drives/partitions

Mounting devices/configuring, accessing and sharing network resources

Working with shell scripts

Troubleshooting/checking logs

Useful Linux command-line tricks

Getting free help/resources for further information

In Part I, we examined these three Linux concepts and how they work:

Creating and managing user accounts, passwords and groups

Working with files, directories and permissions

Granting administrative privileges

In this second installment of the series we’ll move on to cover the following topics:

Installing programs/services and setting startup processes

Managing running processes

Working with user environments

As stated in Part I, prerequisites for users of this guide are familiarity with concepts of system administration such as
creating users, working with permissions, managing programs and processes, configuring hardware such as network
details and hard drives and reviewing event logs for errors.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
28

1. Installing programs/services and setting


startup processes
Installing programs
Windows programs generally install to the C:\Program Files or C:\Program Files (x86) directories (the latter for 64-bit
systems running 32-bit programs). It’s a bit less predictable with Linux; programs might install to the /usr/bin, /usr/sbin,
/usr/local/bin folders or another location such as a home directory or the directory in which a user just happened to run
an installer.

If you know the name of the installed Linux program you can find out where it resides by using the “which” command.
For instance:
which firefox

will return something like:


/usr/bin/firefox

A major difference between Windows and Linux is that Windows installs programs through executables (“setup.exe”
for instance) and Linux generally uses a package manager program, whereby packages are software installers (these
may end in .rpm for Red Hat Linux since this stands for “Red Hat Package Manager).

Installing programs using the graphical user interface (GUI) in Linux works in a similar fashion to Windows. Unlike
Windows there are several available GUI options for Linux (Gnome and KDE being two examples), however the process
of installing programs is the same; you download the installer (also known as a package) from the internet or access
it from installation media such as DVDs or flash drives. The installer is run simply by double-clicking it and following
prompts.

As with Windows, you have to have the appropriate permissions to install software in Linux, of course, so throughout
this article all instructions assume you have root permissions.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
29
Here is an example of installing Chrome for Linux from Google’s website using the GNOME interface:

You can leave the Package installer as the default program to open this file and click OK. The file is then downloaded.

Once the download completes the installation process begins.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
30
Here it’s simply a matter of clicking “Install” and waiting for the process to finish.

Installing programs via the command line in Linux is a bit different than in Windows and there are multiple ways to
do this depending on which type of Linux distribution you’re working on. You can download files from the internet via
the command line using the wget command followed by the URL of the file. For instance to install a program called
Webmin, which is a web-based interface for system administrator for Linux type:
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.700-1.noarch.rpm

(if you use a proxy server you’ll need to provide the relevant information when using wget; this appears in the form of
wget [URL]:[proxy password]@[proxy IP or name]:[proxy port] — for instance:
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.700-1.noarch.rpm:password@10.1.1.1:8080

This will produce output similar to the following:

This will show the .rpm file being downloaded to the local directory. You can then run this command to install the file
(remember, you have to have the appropriate privileges):
rpm -U webmin-1.700-1.noarch.rpm

You can see the results here:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
31
By the way, Webmin is a fantastic interface for new Linux administrators to learn more about and configure their
systems. It shouldn’t be used in place of the commands you ought to learn to maximize your understanding of Linux,
but it can help you learn about your system and what it does as you build more experience. When installed, Webmin
it sets up a local web server interface with many useful options:

It’s also possible to use the command line to download a zipped file containing source files which need to be compiled
to install and run. These zipped files usually end in .bz or .gz and can be downloaded using wget. You then need to use
the local tar command to extract them.

To install source files from a file ending in .bz:


tar -xfv filename.tar.bz

This extracts the contents to a new folder corresponding to the “filename” listed in the .bz file.

To install source files from a file ending in .gz:


tar xzvf filename.tar.gz

(This is also known as a tarball)

This command extracts the contents to a folder corresponding to the “filename” listed in the .gz file (it may or may not
include the version number).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
32
Now type these commands:

cd “filename” (whereby “filename” represents the folder created in the previous step)

./configure
make

make install (or sudo make install if you need elevated privileges, which were covered in Part I)

For example, to download and install an image editor called ImageMagick enter:
wget http://www.imagemagick.org/download/ImageMagick.tar.gz

This will connect to the site listed and download the file:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
33
Typing tar xzvf ImageMagic.tar.gz extracts the files to a folder called Imagemagick-6.8.9-7.

You can type ls –l to verify:

Use cd Imagemagick-6.8.9-7 to enter the directory.

Run ./configure to prepare the program for installation

(when running some executables within a specific folder prefix it with “./” without the quotes to tell Linux to run from
that folder, otherwise you would have to specify the full path which in this case would be /home/root/
Imagemagick-6.8.9-7).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
34
You should see activity indicating various factors are being checked and folders/files created as shown:

When this finishes you will return to the command prompt.

Type:
make

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
35
This will begin compiling the program:

When finished, run make install which copies the compiled files into their appropriate locations. Once this is done, the
program is ready for use; in the case of ImageMagic various executables can be run to start editing images (these are
signified by the “x” permission as discussed in Part I; running ls –l will show this information).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
36
The above methods work well enough for one-off installations, but there is a bigger picture available in the form of
bundles of applications from which you can pick and choose what you want to install. These are known as package
repositories (or collections), and can exist as a local repository on the system itself (such as a DVD containing software
packages) or on another server (within the network or on the internet, for instance).

The concept of a repository may seem confusing overkill. After all, with Windows you just run the executables you
want to kick off, such as Microsoft Office, Adobe Reader or antivirus program installations, then when you’re done the
system will be set up the way you want it. The advantage of a repository in Linux is that it lets you add the programs
you like from one or many centralized sources. It’s generally easier to rely on your Linux package manager to add most
if not all programs you may want to install, rather than loading them from installation media or downloading them
separately. You can also update them from this single source when newer releases come out (assuming it’s a live
repository).

This article focuses on Red Hat Linux (generally the business standard), and Red Hat uses the “yum” (Yellowdog
Updater, Modified) or “rpm” (Red Hat Package Manager) commands to install software. Yum is generally preferred since
it offers more options and can install or update packages more easily, and it has more native repository functionality.
Both commands (where applicable) will be described below.

Setting up a repository
First you have to set up the repository so Linux knows about it and where to find the packages it contains. Repository
information can be kept in a file called /etc/yum.conf or in a text file (generally a .repo file) kept in the /etc/yum.repos.d
folder. Multiple files can exist in this folder.

Yum will read the contents of all files and, assuming the repositories configured herein are enabled (which this article
will show you how to do), will know where to find the necessary information. Using multiple repository files is handy if
you need to add temporary or multiple selections.

To set up a repository of packages from the Red Hat


Enterprise Linux DVD
This is the simplest method and best to start out with if you’re a novice. Insert the Linux DVD in the drive of the system
(or mount it as an .iso if this is a virtual machine).

You’ll probably notice the DVD appears as available in the GUI, but it needs to be mounted for use in a command
(or terminal) window. Remember there are no drive letters in Linux; folders and volumes are prefaced with the / sign.

Open a terminal prompt in Linux as root.

Type:
mkdir /mnt/dvdrom

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
37
This sets up a mount point for the DVD media in a directory called dvdrom under the main mnt folder.

Now mount the CD/DVD ROM in the dvdrom directory:


mount /dev/dvd /mnt/dvdrom

Confirm you can read files from the DVD via the terminal window by typing:
cd /mnt/dvdrom
ls

You should then see a listing of the contents of the DVD.

Now you’ll need to create a .repo file to access packages on the DVD. This involves creating a file called rheldvd.repo
under /etc/repos.d directory.

Type:
vi /etc/repos.d/rheldvd.repo

This creates a blank text file in the vi editor.

Press the Insert key to begin entering data.

Add the following details.


[dvd]
name=Red Hat Enterprise Linux Installation DVD
baseurl=file:///mnt/dvdrom/Server
enabled=1
gpgcheck=0

Save and exit the file via :wq!

The “[dvd]” entry signifies this is a DVD, which signifies where the packages are located.
The “baseurl” entry points to the “Server” folder on the DVD which stores the packages.
(if you are using a different DVD make sure the folder you specify contains .rpm files and a repodata folder)
The “enabled=1” entry signifies that this repository is enabled.
The “gpgcheck=0” entry tells yum not to perform a GPG check on packages for security (this is acceptable since it’s
your installation DVD).

You can confirm yum sees the repository by typing:


yum repolist enabled

It’s also possible to set up a more advanced repository based on an internal or public internet site. First let’s take a look
at how to work with yum then we’ll discuss how to use a website for a repository.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
38

Working with packages


First let’s see which packages are installed.

Type:
yum list installed (or rpm –qa)

The screen above is simply an example of which packages may be present; your system might vary.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
39
To see if a specific package is already installed type:

yum list installed {packagename} (or rpm –qa | grep {packagename}.

For instance, to see if Firefox is installed, type:


yum list installed firefox

The above screenshot shows firefox is indeed installed.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
40
To show the packages you can install type:
yum list available (or rpm –qa)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
41
You will see a screen similar to the above. There are obviously quite a few entries here, so to search for a particular
package use “yum search.” For instance:
yum search adobe

will show you any Adobe-related packages such as the following:

You can find more information about a package by using “yum info {packagename}” (or rpm –qi {packagename}.
For instance, to find out more about a package called zoo.x86_64 type:
yum info zoo.x86_64

If you wanted to install zoo.x86_64 you would type:


yum install zoo.x86_64 (or rpm -i zoo.x86_64)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
42

To run the app just execute the package name (generally you can leave off the trailing characters such as “x86_64”),
which in this case is zoo:
zoo

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
43
What if you want to remove a package? Let’s say Firefox isn’t impressing you. You can uninstall it by typing:
yum remove firefox (or rpm -e firefox)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
44
Note that the DVD won’t automatically mount the next time the system boots up (you’d have to type “mount /dev/dvd
/mnt/dvdrom” after every reboot, though this can be set up as a permanent mount, which is discussed in “Mounting
devices” in Part III ). Therefore, it is recommended to disable the repository once you’re done installing packages:
vi /etc/repos.d/rheldvd.repo
change “enabled=1” to “enabled=0” (without the quotes)
Save and exit the file via :wq!

To set up a repository of packages from an internet site


To connect to an internet site and use it as a repository, your system must have network and internet access (concepts
which you should be familiar with in order to proceed).

This may already be set up if you’re working in a test environment using dynamic host control protocol (DHCP) to
automatically assign IP addresses. You can confirm this by opening a web browser from the GUI (Firefox is generally
installed) and making sure you can get online.

If you need to configure network access manually you can do so from the command line as root using these
commands:
Ifconfig eth0 up

(this activates the default network interface card, usually known by Linux as “eth0.”

Then run:
ifconfig eth0 [IP address you want to use]
ifconfig eth0 netmask [subnet mask you want to use]
route add default gw [default gateway] eth0

This will set the interface IP address, subnet mask and default gateway.

It’s also useful to ensure this system has access to a DNS server to look up host names on the internet and translate
them to the IP addresses needed for communication.

Type:
vi /etc/resolv.conf

Hit insert to edit the file.

Add the line:


nameserver [your DNS server IP address]
enter :wq! to save and exit the file.

Test the network/internet access before proceeding.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
45
Red Hat requires a subscription manager to use their online repository, which involves setting up an account with Red
Hat and registering the system with their site. Details of this process are outside the scope of the article since the goal
is to show you how to work with various types of repositories depending on your needs, however it is encouraged that
you find out more about these details if you intend to roll out or support Red Hat Linux in a corporate environment.

For testing purposes, you can set up access to a public Linux yum repository on the internet (plenty can be found via
Google and this article also provides two examples). This involves creating another .repo file in the /etc/yum.repos.d
folder then linking to the public URL of the repository. It’s also possible to install the appropriate files directly from the
internet to set up a repository.

In the examples below we’ll use apt.sw.be and www.elrepo.org.

First you will need to make sure you know what type of CPU you have (32 or 64-bit) in your Linux version. Type:
cat /etc/*release

Note the results. Now type:


vi /etc/yum.repos.d/apt.repo

Hit insert, then add this information:


[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl=http://apt.sw.be/redhat/el6/en/$releasever/$basearch/
enabled=1

[updates]

[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl=http://apt.sw.be/redhat/el6/en/$releasever/$basearch/

Note $releasever – should be the Red Hat version such as 6.4.


Note $basearch – should be the processor type; i386 for 32-bit and x86_64 for 64-bit.

Save and exit the file via :wq!

If you use a proxy server add the information to yum.conf. Type:


vi /etc/yum.conf

Hit insert, then under the [main] section add:


proxy=http://[proxy server name or IP address]:[port]
proxy_username=[account]
proxy_password=[password]

(the last two lines are only needed if the proxy server requires authentication)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
46
Save and exit the file via :wq!

(Note that all future references to editing files will involve using the above vi steps to open, edit and save/exit)

Now when you use the yum commands outlined above (start with yum repolist enabled) these should apply to the
online repository. As an alternative if you’d like to branch out further, you can add another online repository such as
Elrepo.org via a more direct method which lets you import the appropriate yum information directly.

You need to run this command to import the public encryption key (this is recommended for security reasons), and this
is a good example of a way to use the rpm command directly against a public file on the internet:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

(if you use a proxy server add “--httpproxy [proxy server name or IP address] --httpport [proxy server port]” after the
rpm command; for instance:
rpm –httpproxy 10.1.1.1 –httpport 8080 –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

This command installs the software for Red Hat 5:


rpm -Uvh http://www.elrepo.org/elrepo-release-5-5.el5.elrepo.noarch.rpm

This command installs the software for Red Hat 6:


rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

If you have problems with this command try to access the above URLs via a web browser to make sure they are valid.
Once these run successfully they will create a file at /etc/yum.repos.d called elrepo.repo, which appears as follows:

### Name: ELRepo.org Community Enterprise Linux Repository for el6

### URL: http://elrepo.org/

[elrepo]
name=ELRepo.org Community Enterprise Linux Repository - el6
baseurl=http://elrepo.org/linux/elrepo/el6/$basearch/
http://mirrors.coreix.net/elrepo/elrepo/el6/$basearch/
http://jur-linux.org/download/elrepo/elrepo/el6/$basearch/
http://repos.lax-noc.com/elrepo/elrepo/el6/$basearch/
http://mirror.ventraip.net.au/elrepo/elrepo/el6/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo.el6
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
47
[elrepo-testing]
name=ELRepo.org Community Enterprise Linux Testing Repository - el6
baseurl=http://elrepo.org/linux/testing/el6/$basearch/
http://mirrors.coreix.net/elrepo/testing/el6/$basearch/
http://jur-linux.org/download/elrepo/testing/el6/$basearch/
http://repos.lax-noc.com/elrepo/testing/el6/$basearch/
http://mirror.ventraip.net.au/elrepo/testing/el6/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-testing.el6
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

[elrepo-kernel]
name=ELRepo.org Community Enterprise Linux Kernel Repository - el6
baseurl=http://elrepo.org/linux/kernel/el6/$basearch/
http://mirrors.coreix.net/elrepo/kernel/el6/$basearch/
http://jur-linux.org/download/elrepo/kernel/el6/$basearch/
http://repos.lax-noc.com/elrepo/kernel/el6/$basearch/
http://mirror.ventraip.net.au/elrepo/kernel/el6/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el6
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

[elrepo-extras]
name=ELRepo.org Community Enterprise Linux Extras Repository - el6
baseurl=http://elrepo.org/linux/extras/el6/$basearch/
http://mirrors.coreix.net/elrepo/extras/el6/$basearch/
http://jur-linux.org/download/elrepo/extras/el6/$basearch/
http://repos.lax-noc.com/elrepo/extras/el6/$basearch/
http://mirror.ventraip.net.au/elrepo/extras/el6/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-extras.el6
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
48
Here are some further yum commands to use when you have a live repository which may contain updates now or in
the future.

Command
Purpose
yum list updates Shows updates available for existing packages
yum update check Update all packages in the yum repository
yum update ${packagename} Update a specific package
or
rpm -U ${packagename}

It’s worth pointing out that once you have your repository set up in yum packages will also be available to install via the
GUI (but installed packages likely won’t show up in the menus of the GUI, unlike Windows).

For example, in Red Hat Linux 5.2 running the GNOME GUI you would click Applications then choose Add/Remove
Software:

You can browse the packages, grouped under “Desktop Environments,” “Applications,” “Development,” “Servers,”
“Base System” and “Languages” and add the ones you want by ticking the box to the left and clicking “Apply.”

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
49
The Package Manager looks different and is accessed in a different way in Red Hat 6.4 running the GNOME GUI; click
System then choose Add/Remove Software:

The interface allows you better access to specific types of packages than in Red Hat 5, but these are installed in a
similar fashion.

This provides an elementary introduction into using the basics of yum to handle package management.

Working with startup processes


In Windows, startup processes (these can be scripts, programs or services) are set up via the Services console,
the Startup folder or the msconfig command, which lets you control all startup programs.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
50
In Linux, they appear in folders under /etc/rc.d:

To understand why these subfolders exist we need to discuss the Linux runlevel concept. Basically, the boot process
consists of 6 steps:

Reading instructions from the BIOS (basic input output system)

Accessing data on the master boot record to find out what steps to take

Running a boot loader to start Linux

Mounting the root file system and starting up the kernel (the core of the operating system)

Executing the initialization phase in which startup processes are run

Starting runlevel programs

It’s these last two steps which are the key to determine what startup processes will kick off with Linux and they work in
conjunction. The runlevel is a sort of operating system state and consists of the following options:
0-halt
1-Single user mode
2-Multiuser without network file systems
3-Full multiuser mode
4-Unused
5-X11 (this is the default; X11 refers to the display manager used to provide a graphical user interface
6-reboot

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
51
These 6 runlevels correspond to the folders shown in the screenshot above; whatever elements are contained in these
folders will start when that particular runlevel commences.

You can enter a different runlevel (assuming you have root permissions) at any time by typing:
init [runlevel]

For instance, to enter runlevel 3, full multiuser mode without the GUI, type:
init 3

This will immediately close down the GUI and log you out, presenting a text-only login and interface.

Typing init 6 would immediately reboot the system.

The startup runlevel is set by the /etc/inittab file. In the screenshot below, the “id:5:initdefault:” entry signifies the run-
level for this operating system is 5:

To change the runlevel you would edit the file as demonstrated in previous examples. Obviously setting it to 0, 4, or 6
would yield problematic results.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
52
Since runlevel 5 is the default for Linux, let’s see what that directory contains:

This folder contains items that are configured to run at start up OR shut down (programs that start with “S” are for
startup and programs that start with “K” are for shutdown).

The digits in the programs listed here signify the order in which Linux starts them up. For instance, “S01sysstat” is the
first program to be launched while “s99webmin” is the last (this makes sense since it was installed in a prior example).

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
53
You can also use the “chkconfig” command in Red Hat Linux to view services.
Chkconfig –list
will show you which services are set to run for each runlevel:

As you can see, many here are configured to start during the default runlevel 5.

You can use chkconfig –list “service” to get information about a particular service.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
54
You can use the “service” command to stop and start services if you want to do so temporarily such as to fix a problem
or have a change take effect. For instance, service postfix stop and service postfix start will produce the following:

You could also use service “service” restart if you just wanted to restart it.

What if you want to prevent a service from ever starting up again? Simply type:
chkconfig “service” off
where “service” represents the name of the service in question.

Changed your mind and want that service back? Easy – type:
chkconfig “service” on

You can also set a service to run in a different runlevel by adding the –level [level] switch. For instance, if you want
a service to run in runlevel 1 but not 5 use:
chkconfig “service” on –level 1

for multiple runlevels such as 1 and 5:


chkconfig “service” on –level 1,5

To delete a service entirely use chkconfig “service” –del

The /etc/init.d folder contains scripts used for handling existing services. If you had a script you wanted to have
execute at boot time you could copy it here; it should be owned by root (use the chown command as shown in Part I)
and set it as executable.

To simplify things even further, if you wanted the system to run a single command at startup you could add it to the
/etc/init.d/rc.local file which appears similar to the following:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
55

2. Managing running processes


Now that we’ve established how to handle startup processes, what about checking for running programs or scripts
to see what’s happening in the background? With Windows it’s easy enough to just hit Ctrl-Alt-Del, choose “Task
Manager” then view the Processes tab. With Linux you need the “ps” command.

At first glance, just running ps doesn’t seem too insightful:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
56
However, as is often the case with Linux, the command switches make the difference. Try running this instead:
ps aux

The above shows much more detailed information, such as the user ID associated with the process, the PID (process
identifier; a sort of unique fingerprint corresponding to the process which Windows also uses), the CPU and memory
being used by the process, when it was started, the command involved, etc.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
57
All of this data is added by the “aux” switch which provides the following details:
a = show processes for all users
u = display the process user/owner
x = show processes not attached to a terminal (e.g. running from a remote session)

To search for a particular process such as webmin you can use:


ps aux | grep webmin*

(“grep” is a search command and the pipe or “|” symbol chains the two commands so that their results are linked)

This shows the following on the test system running webmin:

It’s interesting to note that the command shows both a webmin script running (in this case via Perl) and the search for
webmin itself.

There are many more command switches for ps which can be referenced online.

To kill running processes you need the information displayed by ps aux and the kill command. Take note of the PID
associated with the process.

Type:
kill [processor identifier]

Let’s say you wanted to stop the webmin process, which is using the PID of 21391.

Type:
kill 21391

In the above screenshot the webmin process has been killed, and ps aux | grep webmin* run once more to confirm that
it is gone.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
58

3. Working with user environments


As mentioned before, Red Hat Linux provides an array of graphical user interfaces (GUI) such as GNOME (probably
the most popular) and KDE. These constitute as different user environments and can be installed as packages (you can
find alternatives via Google, of course, and install them separately depending on your taste).

You can choose which interface to use at logon by clicking Session and then selecting your desired option. You’ll be
prompted when you proceed as to whether you want to make that session the default for all future sessions if you’re
choosing something different from the default.

However, there are also specific Linux user environments in the form of profiles, the same as in Windows, which sets
a different profile for each user consisting of settings, files, shortcuts, appearances and other unique customization
details. Windows keeps these in the c:\users folder (for Windows 7 and more recent releases). The Linux user
environments are kept under the /home folder, which has a subfolder corresponding to each user. These are created
when users log in for the first time. When users open a terminal window it defaults to their home directory. They can
access the home directory at any time using the tilde symbol: ~

For instance, typing cd ~ will take you to the home directory in the shell.

If you type ls –l you will see the contents of the home directory. For example, on Red Hat Linux 6 it will appear as
follows:

This certainly is a close parallel to a Windows profile folder, which contains many similar folders such as Desktop,
Documents and Downloads. However, just like in Windows, there’s more beneath the surface in the form of hidden files
and folders that control greater aspects of the user environment.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
59
Type ls –all to show all files and folders:

Anything beginning with a period is normally invisible and hidden from display. Many of the hidden directories
(directories start with “d”) shown here have to do with background details such as the Gnome environment or ssh
details.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
60
In order for you to understand how some of the files associated with a user profile work, it’s important to discuss shell
types.

When you open a terminal window you’re actually entering a shell, which is a program that interprets commands.
There are many different types of available shells in Linux (and Unix), such as sh (also known as Bourne Shell),
csh (also known as C shell, since it resembles the C programming language), and the most common one, bash,
or Bourne Again shell.

The bash shell consists of several files which define the profile environment:

File Description

.bash_profile A user’s personal initialization file which runs only at login.

Common uses are to set environment variables such as PATH, JAVA_HOME, create aliases for shell
commands and set the default permissions for newly created files etc. This file works with the
system-wide settings (which can be set for all users) in /etc/profile.

Here’s what a sample .bash_profile file might look like:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
61
A good use of the path statement is adding directories from which you want to run executables without having to type
the full path name. You can append new paths to the existing ones with a colon; to add /usr/local you would edit the
file and change the line as follows:
PATH=$PATH:#HOME/bin:usr/local

File Description

.bashrc The individual per-interactive-shell startup file. Runs every time a user open a new non-login bash
shell via a terminal window. You can also use aliases for shell commands here. This file works with
the system-wide settings (which can be set for all users) in /etc/bashrc.

Here’s what a sample .bashrc file might look like:

You can take advantage of the functions provided by the .bashrc and /etc/bashrc files to set up aliases, which are
command shortcuts. For instance, if you wanted to type “ll” in place of “ls –l” you would edit the file and enter:
alias ll=’ls -l’

under the “ #User specific aliases and functions” section.

File Description

.bash_history Contains a history of all commands typed into the terminal window by a user throughout all sessions,
not just the current or recent ones

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
62
Here’s what a sample .bash_history file might look like:

You can also display these by typing history.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
63
If you want to search the history log for a particular command you can do so using history | grep “command”.
Additionally, You can clear the history log by typing history –c.

File Description

.bash_logout Contains commands you want to run when a user logs out of the shell.

You can add commands to this file which may be useful when exiting a shell. The default contains the command “clear”
to clear the screen:

Profile objects can be copied from user to user as needed, assuming you have sufficient rights. For example, if a user
named jsmith has a .bashrc file you want to copy to a user named nbetling, you would type:
cp /home/jsmith/.bashrc /home/nbetling

There are many more uses for user profiles and their contents; this covers the introductory steps to help you get
familiar with them.

Part I and Part II of this series has covered the first six sections of the Linux introductory concepts. Part III will conclude
the series.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
64

Part III
In the first two installments of this series we took a look at the history of Linux and how it has grown into an essential
force in many enterprise data centers. We also discussed some of the ways in which Windows and Linux are both
similar and different, with the goal of helping to orient new Linux administrators with a background in Windows
operations.

The entirety of this series will focus on the following introductory Linux concepts:

Creating and managing user accounts, passwords and groups

Working with files, directories and permissions

Granting administrative privileges

Installing programs/services and setting startup processes

Managing running processes

Working with user environments

Formatting drives/partitions

Mounting devices/configuring, accessing and sharing network resources

Working with shell scripts

Troubleshooting/checking logs

Useful Linux command-line tricks

Getting free help/resources for further information

In Part I and II, we examined these three Linux concepts and how they work:

Creating and managing user accounts, passwords and groups

Working with files, directories and permissions

Granting administrative privileges

Installing programs/services and setting startup processes

Managing running processes

Working with user environments

As stated in Part I, prerequisites for users of this guide are familiarity with concepts of system administration such as
creating users, working with permissions, managing programs and processes, configuring hardware such as network
details and hard drives and reviewing event logs for errors. Furthermore, these tips and screenshots are based on Red
Hat Linux administration, since that is generally the corporate standard, but should also work on most if not all other
Linux flavors.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
65

1. Formatting drives/partitions
This document refers to “drive” or “disk” as terms representing anything seen by Linux as a disk drive, whether it is an
actual internal or external hard disk or a CD or DVD drive.

Adding new hard drives and partitions in modern versions of Windows is fairly straightforward. You go to Computer
Management (workstations) or Server Manager (servers), expand Storage then access the Disk Management Utility,
where you can bring drives online and offline, initialize drives, create, format, shrink and extend partitions and volumes,
and assign letters to drives, such as H: drive for a newly installed disk.

The Red Hat Gnome GUI environment includes a program called Disk Utility which can be accessed from the main
menu under “Applications” / “System Tools.” It provides a graphical view of a Linux file system which offers control
functions similar to Windows:

This is really just a front end to what’s happening behind the scenes on a Linux file system. There are also other ways
to use the GUI for disk tasks, such as the Logical Volume Manager (LVM). However, you can view and administer drives
and partitions right from the command line, and it is highly recommended that you do so to get a good feel for how the
system operates and uses disk resources.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
66
Take note of the sections in the screenshot above which read: “Device: /dev/sda” and “Device: /dev/sda1” since these
factor in during the next section. But first, a background on how drive access works in Linux.

Drives and their access (“mount”) points work differently in Linux as compared to Windows. As a reminder, Part I
focused on how files and directories appear on a Linux system - whereas a Windows server may have folders such
as C:\Users, C:\ProgramData and C:\Windows, Linux doesn’t use a C: drive, or any drive letter at all. Instead, Linux
organizes directories on file systems with each folder preceded by a “/” or forward slash. This starts at the root or
topmost directory, which is represented by “/” and then applies to all top-level folders and subfolders — examples
include /bin which contains programs needed for the boot process, /dev, where device files for hardware components
are located, and /home which contains user folders.

In Windows you might format a new hard disk and set the new volume as the H: drive, but in Linux you would create
the partition, set up a file system on it then mount the volume with a specific name underneath the root or / location.
Say you wanted the new drive to be used for application storage – you could mount it as /appstorage, then it would
appear in the main directory tree:
/
/appstorage
/bin
/dev

Since there is no drive letter associated with a volume they can all be displayed under the root location, even if they’re
on different disks or systems. This presents a more unified, inclusive view of all mounted volumes.

While you can use the “ls” command to show directories, a better option is the “df” command, which stands for “disk
filesystem.” Running this will show a screen similar to the following:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
67
This shows you disk data in bytes, so using the “-h” switch to display it in “human readable” format makes a bit more
sense:

Now we get to the /dev/sda and /dev/sda1 sections referenced previously. Linux identifies different types of drives
using different letters.

Drive name Drive type


hda, hdb, hdc, etc. IDE
sda, sdb, sdc, etc. SCSI (or something emulating SCSI such as a USB drive)
vda, vdb, vdc Virtual Disk
sg or sr (aliased to cdrom or dvd) CD/DVD disks

The first two letters indicate the type of drive and the third shows the drive number in the system. The third letter
increments with each subsequent drive added, so “sda” would be the first drive in a system, “sdb” the second,
and “sdc” the third, for instance.

Partitions on each drive are associated with a number NOT a letter, so “dev/sda1” would be the first partition on the
first drive. “Dev/sda2” would be the second partition on the first drive. “Dev/sdb1” would be the first partition on the
second drive, and so forth (note this numbering scheme applies to Red Hat Linux; the Ubuntu Grub boot loader starts
at 0 not 1).

Drives and partitions — whether actual or potential — appear under the /dev directory. You can view them by typing:
ls /dev

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
68
In the above example, the system is a virtual machine and so it has two drives:
vda
vdb

The vda drive has three partitions:


vda1
vda2
vda3

For the purpose of this demonstration, a second drive of 26 Gb in size has been added to the virtual machine and it is
now represented by vdb. The vdb drive is blank; it has no partitions.

So how can you actually create and format a volume on a new disk? First you’ll need to sudo to root to perform the
operation. Type sudo –s then enter the appropriate password.

Now we can use the fdisk command to examine and configure drive information (this assumes drive sizes of 2 Tb or
smaller; larger drives would use the parted command but since this hard drives are frequently less than 2 Tb we’ll focus
on using fdisk).

Type:
fdisk –l

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
69
The new vdb drive is listed here and the file size is displayed in bytes; in this case it is about 26 Gb in size. We already
identified the new drive as vdb, but using fdisk –l can be helpful in finding the name if you’re unsure.

Now we’re ready to create a partition on the new drive. It’s possible to create a partition and file system on a new drive
and then mount this for access or adding the drive as a physical part of an existing volume group. We’ll focus on the
first scenario; the second one is outside the scope of this article but Red Hat provides instructions for this.

Run:
fdisk /dev/(device)

In the example of the new virtual hard drive you would run:
fdisk /dev/vdb

In the above example, a warning appears that “DOS-compatible mode is deprecated. It’s strongly recommended to
switch off the mode (command ‘c’) and change display units to sectors (command ‘u’).” If you receive this error type c
and then u as recommended:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
70
It’s worth typing m to display the help screen so you can learn more about the functions of fdisk:

If you type p to print the partition table it will show nothing present:

Type n to create the new partition. You will be given the choice of creating an extended or primary partition:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
71
To use the entire disk as a single volume, choose p. An extended partition comes in handy if you intend to create more
than four primary partitions (since that is the limit) but for the purpose of this example we’ll stick with a single primary
partition:

The system will prompt for the partition number; 1 was entered since that is the first choice available. The defaults on
the first and last sectors were also selected, and the partition was created.

Type p to print the partition table:

You can see that the new vdb1 partition now exists.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
72
Type w to write the partition table changes:

You can verify the new partition is present under the /dev directory by typing:
ls /dev/vd*

You have to create a file system on the partition then mount it before it can be used. Windows uses file systems such
as FAT (rare), FAT32 and NTFS. Linux can use those too, but the native counterparts are generally EXT3 (standard for
many years) and EXT4 (more modern versions).

You can tell which file systems are in use typing:


mount | grep “^/dev”

This will display something similar to the following:

In this case we can see that EXT4 file systems are in use, so this is what we’ll work with.

The utility to create an EXT4 file system is called mkfs.ext4 (a similar utility exists for EXT3 file systems and is called
mkfs.ext3). Let’s say we want to create a volume and label it as appstorage. We would run:
mkfs.ext4 -L /appstorage /dev/vdb1

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
73
This creates the volume, formats it and applies the label:

Now that we’ve established how to format drives and partitions, let’s see what comes next.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
74

2. Mounting devices/configuring, accessing and


sharing network resources
We must mount the volume in an accessible location by setting up a mount point.
Type:
mkdir /mnt/appstorage
mount /dev/vdb1 /mnt/appstorage

(the first command sets up the mount point in a folder, and the second actually mounts the volume to that accessible
location)

Both commands should complete successfully. Now run:


df –h

As you can see, the new volume is mounted at /mnt/appstorage and is available for use (you could also select
/appstorage instead of /mnt/appstorage if you wanted the new volume to appear at the root level).

Typing mount will show all mounted file systems:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
75
You can perform these same steps with external/USB flash drives (Linux may automatically make them accessible from
the GUI but not from the command line):

1. Find out what drive the USB stick represents (e.g. sdb)

2. Create the partition on the USB stick

3. Create a file system on the USB stick

4. Create a mount point under the /mnt folder (e.g. /mnt/usbdrive)

5. Mount the USB stick file system to the mount point

If the USB stick already has a file system on it you can skip steps #2 and #3.

To backtrack, if you need to unmount a file system simply type umount (mount point). For instance:
umount /mnt/appstorage

will work for the example above.

You can delete partitions in a similar fashion; run fdisk /dev/(device), then use d to delete the partition(s) and follow the
respective prompts.

There’s one more thing to do if you want to make the mount point permanent: add the details to the /etc/fstab file,
which is the file systems table in Linux; this controls what gets mounted at startup.

Type:
vi /etc/fstab

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
76
The fstab file is then displayed:

Each column in the fstab file represents a certain field:


File system name/label
Mount point
File system type
Mount options (defaults are generally fine)
Dump Options (determines backup options by the dump utility; generally OK to select 0)
File System check order (select 2 since this is the 2nd drive on the system, but you can select 0 if you don’t want the
volume checked)

Press insert to enter text then use the arrow keys to go to the bottom of the file and add a new line.

For the /appstorage mount point we would add:


/dev/vdb1 /mnt/appstorage ext4 defaults 0 2

In Part II we discussed mounting a DVD drive for access to installation packages. To set up a DVD as a permanent
mount you would add this line to fstab:
/dev/dvd /mnt/dvdrom auto defaults 0 0

(it should be noted you would have to unmount the DVD volume via umount (mount point) every time you wanted to
switch discs then remount it once the new one is loaded)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
77
Save and exit the file (using :wq!, remember), then reboot and confirm the volume remains present by running df –h:

If you should need to take out failed mount points (such as on a dead drive), simply edit the file again and add a “#” in
front of the line, so Linux will not try to mount it the next time it starts up.

Connecting to other Linux systems


This is an overview of how to mount local disks for use. But what about accessing network disks on other Linux
systems? In Windows it’s possible to map a drive from Windows Explorer or the command line via the “net use [drive
letter] \\server\share” command. With Linux you would follow the same mount process as with local disks, with a few
stipulations:

1. The target file server must have the NFS (network file system) or SMB (Server Message Block) service installed and
running (this article works with NFS, though SMB can be a good choice to share files between Linux and Windows
systems).

2. The directory must be exported (shared) on the target server in a file under /etc/exports.

3. You must have network connectivity and permissions to the directory (a group works best) for remote access. This
guide assumes no firewall restrictions are in place between hosts, but this should be analyzed in a live environment
and adjusted accordingly.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
78
Let’s refer back to the fstab file on the test system:

The bottom entry for “devnfs:/tools” shows an NFS volume on the devnfs server mounted locally (and set to do so
every time Linux boots).

The command to perform this works as follows:


mount (server):/directory /(local mount point)

To mount the above example, you would use:


mount devnfs:/tools /tools

How are directories set up for remote access?


In this example the devnfs server has an entry in the /etc/exports file which appears as follows:
/tools *(rw,sync)

The /tools entry is the name of the directory to be shared.

The asterisk (*) signifies access is permitted from any machine (this can be replaced with a specific host name,
a series of hostnames separated by asterisks to connote wildcards, or IP network addresses/network ranges).

The rw entry signifies read/write access for remote users. This can be removed to apply the default of
read-only access.

The sync entry indicates that the server will not reply to remote requests before related changes are written to
disc; this helps to ensure integrity of read-write data. For a read-only volume you should use async instead.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
79
So, let’s say you have a folder on a system you want to export for others to access. Follow these steps:

1. Make sure they have the appropriate local accounts and permissions to that location (covered in Part I). For testing
you could run chmod a+x (folder) to grant all users read, write and execute capabilities to the folder, but in a live
production environment you would likely want to restrict access more carefully by selecting the right usage of the
chmod command.

2. Make sure network access exists between the local and remote machines (and again, that no firewalls are in use,
or if there are exceptions have been set up — see this Red Hat article for more information)

3. Your local and remote systems must have NFS installed (we covered how to install packages in Part II; this package
is called nfs-utils)

4. Create an /etc/exports file on the system on which you want to export (share) a directory using the following
command:

vi /etc/exports

(this will create a new file if it does not already exist)

Model the content after the above example. A basic entry will include mount point, access, read-write capability (if
desired) and sync/async capability. Make sure to eliminate any spaces between the hostname and options in order to
ensure the appropriate access is applied.

Let’s say we want to share out the local volume created previously (/mnt/appstorage) and the system name is
smatteso-vm1.

We would add this line to /etc/exports:


/mnt/appstorage *(rw,sync)

Entering :wq! saves and exits the file.

Now type service nfs reload and the mount point can be accessed remotely (any time the /etc/exports file is changed
you will need to restart the NFS server)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
80
showmount -e will show available NFS mounts on the local system:

showmount –e (hostname/IP) will show the available local NFS mounts on the remote system you want to connect
from:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
81
rpcinfo –p (hostname/IP) will confirm whether the NFS server on the target is listening:

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
82
Now you have to create a mount point folder to use on the system you want to connect from. You can create any folder
name you wish in any location to which you have access. For instance, this command will create a new folder called
appstorage under the /mnt directory:
mkdir /mnt/appstorage

Now mount the remote volume to the local /mnt/appstorage (or whatever folder you have designated as the mount
point) location:
mount smatteso-vm1:/mnt/appstorage /mnt/appstorage

(you could also use “mount –t nfs” instead to signify that you are mounting an nfs file system)

No confirmation will be given that the remote volume mounted, but you can confirm by typing:
df –h

which should reveal:

You can see the remote volume mounted, and if you access the local /mnt folder you will see the appstorage directory
listed. You can read, write and execute files here as needed depending on available permissions.

Want to automatically mount this network folder every time the system boots? Just edit the /etc/fstab file and add a line
similar to the following:
smatteso-vm1:/mnt/appstorage /mnt/appstorage nfs defaults 0 0

Need to disconnect a network folder? Use the umount (mount location) command, such as:
umount /mnt/appstorage

(don’t run this if you’re actually in the directory or you’ll get a “device is busy” error).

Finally, if you would like to stop exporting a folder on a system, edit /etc/exports to remove the related information, save
and exit the file, then run service nfs reload.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
83

3. Working with shell scripts


The Linux command line gives you flexibility and power, but typing commands over and over can be repetitive and time
consuming. Windows administrators are likely to be familiar with scripting capabilities such as Powershell and Visual
Basic scripts or even DOS-based batch (.BAT) files which can store a series of commands to run later (or schedule
for execution at a predetermined time). Linux offers similar options in the form of shell scripts, which can greatly ease
administrative burden and streamline operations.

A shell script is a standard file in Linux (though it often ends in .sh to connote that it is a shell script; this makes it easier
to organize and search for items of this nature) with execute (x) capabilities so that it can be run by users with the
appropriate rights.

Shell scripts can control all aspects of the operating system, from setting up new users to copying files to remote
shares to installing applications, and they can use variables just as in Windows to facilitate their operation. They are
plain text files that run commands or chain them together to achieve the desired result.

Let’s work with a few samples. Use vi to create a new file called script.sh:
#!/bin/bash
# This is a sample script
echo “Linux script has completed!”

Save and exit the file.

Let’s examine the above script line-by-line.

#!/bin/bash ensures the script runs in the current user’s bash shell environment (covered in Part II)

# This is a sample script is a “remark” statement is signified by the # at the beginning – any information preceded with
a # will not actually run in the script (except for the #!/bin/bash line), but can be used to explain details about elements
within the file.

echo “Linux script has completed!” will display the words “Linux script has completed” on the screen. The echo state-
ment is used to show information regarding the success, failure or status of commands or other elements in a script.

Use chmod+x script.sh to assign the execute permission on the file for your account.

Run it from current directory:


./script.sh

Or use bash script.sh or sh.script.sh (the bash and sh commands can run scripts)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
84
The script returns the following results:

It doesn’t get more basic than this, but this is a good introduction to the scripting world.

Let’s try a more detailed example which will use variables to show who is logged in as well as the current date and
time.

Use vi to create a new script called sysinfo.sh and add these details:
#!/bin/bash
# This script will show who is logged in and current date/time
clear
echo “Hello $USER”
echo “Today is”;date
echo “Number of user logins:”; who | wc -l
echo “Calendar”
cal
exit 0

Save and exit the file.

In the above script, “$USER” is a variable representing the logged-on user (it needs to be in quotes since it is preceded
by a dollar sign).

“;date” is a variable representing the current date and time (it does not need to be in quotes since it is preceded by a
semi-colon).

“;who | wc –l” is a command using the variable “;who” that displays the number of users logged in and piping it (via
the | symbol) to a separate comment that prints a count of the results on the next line — this is a good example of how
commands can be chained together. The pipe command can come in handy in many other areas both in scripting and
direct commands.

Run chmod +x sysinfo.sh.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
85
Now run ./sysinfo.sh and the following information will be displayed on the screen:

Here’s a useful script which will display important statistics about your system such as connected users, disk and
memory usage, utilization, processes and more:
#!/bin/bash
date;
echo “uptime:”
uptime
echo “Currently connected:”
w
echo “--------------------”
echo “Last logins:”
last -a |head -3
echo “--------------------”
echo “Disk and memory usage:”
df -h | xargs | awk ‘{print “Free/total disk: “ $11 “ / “ $9}’
free -m | xargs | awk ‘{print “Free/total memory: “ $17 “ / “ $8 “ MB”}’
echo “--------------------”
start_log=`head -1 /var/log/messages |cut -c 1-12`
oom=`grep -ci kill /var/log/messages`
echo -n “OOM errors since $start_log :” $oom
echo “”
echo “--------------------”
echo “Utilization and most expensive processes:”

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
86
top -b |head -3
echo
top -b |head -10 |tail -4
echo “--------------------”
echo “Open TCP ports:”
nmap -p- -T4 127.0.0.1
echo “--------------------”
echo “Current connections:”
ss -s
echo “--------------------”
echo “vmstat:”
vmstat 1 5
echo “--------------------”
echo “processes:”
ps auxf --width=200
(courtesy of www.tecmint.com, which provided the free sample)

This displays the following output on a test system:


Wed Sep 17 17:32:13 EDT 2014
uptime:
17:32:13 up 5:09, 3 users, load average: 0.09, 0.06, 0.01
Currently connected:
17:32:13 up 5:09, 3 users, load average: 0.09, 0.06, 0.01
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
smatteso tty7 :0 12:24 5:09m 3.13s 0.01s pam: gdm-password
smatteso pts/0 :0.0 12:25 5:06m 0.12s 0.19s gnome-terminal
smatteso pts/1 smatteso-t5500.l 17:31 0.00s 0.07s 0.01s sshd: smatteso [priv]
--------------------
Last logins:
smatteso pts/1 Wed Sep 17 17:31 still logged in smatteso-t5500.litle.com
smatteso pts/2 Wed Sep 17 13:13 - 13:13 (00:00) localhost:10.0
smatteso pts/2 Wed Sep 17 13:13 - 13:13 (00:00) localhost:10.0
--------------------
Disk and memory usage:
Free/total disk: 48G / 73G
Free/total memory: 15447 / 15949 MB
--------------------
OOM errors since Sep 16 17:17 : 16

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
87
--------------------
Utilization and most expensive processes:
top - 17:32:14 up 5:09, 3 users, load average: 0.09, 0.06, 0.01
Tasks: 279 total, 1 running, 278 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.4%us, 0.4%sy, 0.0%ni, 98.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.6%st

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND


4934 root 20 0 15156 1328 880 R 2.0 0.0 0:00.01 top
1 root 20 0 19360 1560 1240 S 0.0 0.0 0:00.78 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
--------------------
Open TCP ports:
utilcheck.sh: line 26: nmap: command not found
--------------------
Current connections:
Total: 643 (kernel 750)
TCP: 31 (estab 4, closed 2, orphaned 0, synrecv 0, timewait 2/0), ports 23

Transport Total IP IPv6


* 750 - -
RAW 0 0 0
UDP 28 17 11
TCP 29 18 11
INET 57 35 22
FRAG 0 0 0
--------------------
vmstat:
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 15093148 120316 605236 0 0 4 4 53 54 0 0 99 0 1
1 0 0 15093096 120316 605236 0 0 0 0 300 347 0 0 100 0 0
0 0 0 15093832 120324 605228 0 0 0 36 383 390 0 0 99 0 0
0 0 0 15093220 120324 605236 0 0 0 0 206 348 0 0 100 0 0
0 0 0 15093344 120324 605236 0 0 0 0 185 326 0 0 100 0 0

(it also displays all processes via ps auxf; these have been left out for space reasons)

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
88
Some common shell script variables within the Bash shell:

$? = the result of the last run command; 0 represents success and 1 (or more) represents failure
$GROUPS = groups the logged-on user belongs to
$HOME = user home directory
$HOSTNAME = host name of system
$HOSTTYPE = system CPU hardware
$PATH = path to executable files
$PWD = current directory
$SECONDS = the number of seconds a script has been running
$UID = user ID number (similar to a SID in Windows)

It’s easy to see how scripts can be created to run functions based on the hostname or CPUs involved, who is logging
in or what groups they belong to. Just as with Windows scripts, Linux scripts can use “if then” conditions whereby “if”
a certain condition applies (a user ID is a certain identifier) “then” a command can execute. You can also supply an
“else” statement to run another command if the condition does NOT apply.

You can set your own variables quite easily by typing (variable name)=(what you want to set the variable to).
For instance:
var=”The command ran successfully”

will assign the phrase “The command ran successfully” to the variable of var. Now if you type:
echo $var

this will return the result “The command ran successfully.”

You can add variable assignments this way within scripts as well.

This covers the basics of shell scripting, but there is much more information available to help expand your scripting
knowledge. Resources which can help are discussed later in the article.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
89

4. Troubleshooting/checking logs
Like any other operating system, Linux sometimes has problems with applications, hardware, user accounts and other
elements of daily computing life. General common sense troubleshooting tips can apply across all operating systems:

Make sure applications are installed properly and match the hardware (64-bit programs with 64-bit CPUs
for instance)

Make sure users have appropriate rights and are using correct passwords

Make sure hardware is functional and appropriate drivers are in use

Make sure proper network access exists

Make sure system processes are running and doing what they should

If something worked previously but won’t work now find out what changed

Research errors to find root causes

Review logs to see what’s going on behind the scenes

Whereas Windows has the Event Viewer for system logs, Linux does not have a centralized “one stop shopping” place
to check when problems crop up; different log files are used for different functions, but many of these are stored in the
/var/log folder. Some examples:
/var/log/anaconda.log = installation related messages
/var/log/boot.log = boot information
/var/log/dmesg = kernel information about the operating system
/var/log/messages = General messages and system related items
/var/log/cron.log = Crond logs (scheduled tasks, also known as cron jobs)
/var/log/dpkg.log = Information about package installations/removals
/var/log/httpd/ = Apache access and error logs directory
/var/log/secure or /var/log/auth.log = Authentication log
/var/log/wtmp = Login records file
/var/log/yum.log = Yum command log

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
90
Red Hat provides the option to configure global logging elements with a process called rsyslogd. It works in
conjunction with a file called /etc/rsyslog.conf which can be edited to specify (or research) the appropriate information.
A sample appears as follows:

If used, this can help pinpoint what log files to look at for certain functions; the file indicates mail problems are kept in
/var/log/maillog and boot messages in /var/log/boot.log. This is the default, but the file can be edited to change this if
necessary.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
91
You can use the cat command to display the contents of a log file. For instance:
cat /var/log/boot.log

will display the contents of the boot.log file.

You may see an overload of information as several screens flow by, however, so better options for displaying files are
the more, tail and grep commands.

more will display a file page by page, allowing you to press f to show the next page. It also displays the current position
in the log via a percentage point in the lower left (for instance if you are 10% through the log). If you need to go back to
view previous pages of the log file you can press the b key. To exit the file press Ctrl-C or Ctrl-Break then q (many
functions in Linux can be exited this way).

(It may be handy to use the more –f switch if the lines of the log file don’t display properly)

The tail command will display the last 10 lines in a log file by default in a “live action” mode whereby new entries to the
log will appear as they are added. You can add the –n (number) switch to specify how many lines to display.
For instance:
tail /var/log/messages –n 25

will show the last 25 lines in the messages log, updating the display as these are added.

What’s especially helpful about tail is that you can use it with multiple files:
tail logfile1 logfile2

(As with more, it may be handy to use the tail -f switch if the lines of the log file don’t display properly)

Finally, grep can be used to search within a log file and return only the results you’re interested in. This example checks
the /var/log/messages file for any instances of the term “error”:
grep error /var/log/messages

(use grep –i to check for a term in case-insensitive format, meaning it would look for any instance of the word error
regardless of upper or lower case)

The resolution to problems you find in these (or other) logs will depend on the situation involved; they may indicate
component failures, authentication or permission problems, missing files or stranger elements. However, these should
provide sufficient insight into what’s happening so that you can then research solutions online.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
92

5. Useful Linux command-line tricks


The possibilities with command line options in Linux are vast and diverse. Here’s a list of some helpful examples which
can make your administrative tasks easier. Try experimenting with these and see what other commands you can find:

Command/Function Description

Up and down arrows Cycle back and forward through previously typed commands.

Ctrl + a Go to the start of a line.

Ctrl + e Go to the end of a line.

Ctrl-Shift-C Copy highlighted text.

Ctrl-Shift-P Paste copied text.

> Output a command to another command or logfile.

cat /proc/meminfo Display current memory information (many other system details can be found
and displayed in the /proc folder). Customize with grep; “grep MemTotal
/proc/meminfo” will only show the total memory for instance.

du -a /var | sort -n -r | head -n 10 Will show you the top 10 largest files in the var directory (customize with another
directory or remove “/var” entirely to show the 10 largest directories on the
system).

du -sh * Shows file sizes of items in the current directory as a summary in human readable
format.

file “file” Displays file type information; ascii text or shell script for instance.

find . -name “file name” Will look for any file name matching the specified string, searching through all
subfolders (make sure to be at the appropriate folder level). Use * for wildcards.
Make sure to cd to the topmost folder in the file system if you want to search
through all files.

history / !(serial number) Run history to display recent commands, each of which has an identifying serial
number. Then run !(serial number) to execute them.

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
93
For instance, history might show these items:

!948 would run “service nfs reload.”

mv “file” “path” Move a file or set of files to a new location.

ps -ef | grep 1 | head Shows running jobs.

pwd Display current directory.

rm “file” Remove a file (use with caution).

rm !(*.ext) To delete all files in a directory except those with certain extensions
(replace .ext with the desired extension).

rm !(*.ext|*.ext) Delete all files except multiple extensions which you want to keep using the
pipe command.

scp (file) (user)@(hostname):(path) Copies a local file to another system. For instance, scp * user@workstation:
/home/user would copy all files in the current location to the system called
“workstation” into the /home/user directory.

ssh (hostname) Connect and log into other Linux systems.

ssh (user)@(hostname) (command) Connect to other systems and execute a command. For instance,

ssh user@workstation ls /var would display the contents of the /var directory on the remote system
“workstation.”

uptime Shows how long the system has been running.

whoami Displays the name of the currently logged-on user

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
94

6. Getting free help/resources for further information


Training courses in Linux are available from companies such as New Horizons and Learning Tree, and there is plenty of
further information in the form of websites and books which can advance your knowledgebase.

One of the historical — but misguided — arguments against free or open-source software like Linux is that without
official paid support it can be difficult to find assistance. After all, businesses are made or broken on good technical
support to keep their systems healthy. It should be noted that companies like Red Hat actually do sell their software
with support options (Red Hat Enterprise Linux), but there are plenty of support forums and websites that are just a
Google search away, and which contain questions and answers from all walks of Linux life.

For Red Hat Linux users, the first place to seek general information and documentation will be the Red Hat site,
of course:
https://access.redhat.com/home

Here are some other helpful Linux links based on category.


Guides and how-tos:
http://www.tecmint.com/
http://www.linux-tutorial.info/
http://www.linux-magazine.com/
http://www.tldp.org/ (The Linux Documentation Project)

Support forums for advice:


http://forums.justlinux.com
http://www.linuxquestions.org/questions/
http://www.reddit.com/r/linux

Linux News:
http://www.linuxjournal.com/
http://www.linuxtoday.com/
http://www.linuxinsider.com/

Copyright ©2014 CBS Interactive Inc. All rights reserved.


TRANSITIONING FROM WINDOWS TO LINUX ADMINISTRATION: A GUIDE FOR NEWCOMERS
95
In addition, TechRepublic’s Open Source blog offers useful, timely tips and information about Linux and open-source
applications:
www.techrepublic.com/topic/open-source/

Some noteworthy books about Linux which can also be useful:


The Linux Command Line: A Complete Introduction by William E. Shotts Jr
Linux for Beginners by Jason Cannon
UNIX and Linux System Administration Handbook by Evi Nemeth, Garth Snyder, Trent R. Hein and Ben Whaley
Linux Bible by Christopher Negus
Linux Cookbook by Carla Schroder

Conclusion
We’ve covered a lot of ground to help get you up to speed using Linux. We’ve gone over how to work with user
accounts (both regular and administrative) and environments as well as groups; files, folders and permissions; setting
up programs and services; configuring and using local and remote drives, shell scripts; troubleshooting and reviewing
log files; handy commands and resources to find out more information.

There is much more to learn — so much, in fact that even experts who have worked with Linux for years regularly find
new ways to do things — and many of the techniques explored here can be accomplished via other methods both
basic and advanced. In addition, some elements or procedures not deemed necessary to this guide have been left
out to streamline the learning process. This guide has been intended as an introductory overview of multiple concepts
rather than a deep dive into one particular area.

Effective system administration involves a diverse understanding of multiple operating systems, so when armed with the
right tools and information the similarities and differences between Windows and Linux can often be a cause for intrigue
and inspiration rather than confusion or frustration. We hope this has been a useful introduction as you begin to explore
the Linux realm and that this serves as a good foundation for your knowledge so you can build upon it further. Best of
luck with all things Linux!

Copyright ©2014 CBS Interactive Inc. All rights reserved.

Potrebbero piacerti anche