Tuesday, 10 December 2019

LPI

Outcert and LPI: Lifelong Learning is More Than a Purpose

LPI Study Materials, LPI Guides, LPI Learning, LPI Tutorial and Material, Dell EMC Certifications, LPI Online Exam
Lital Shoshan Idel tells me, "We want to spread a message to the world. A message as to why lifelong learning it is more than a purpose; it's a vision that must be clear to all of us. Sharing in that desire, the Linux Professional Institute (LPI) is one of our main and great partnerships." Lital is the CEO of Singapore-based, OUTCERT, a technology education platform that aims to simplify professional tech certifications in many different areas, including Linux and Open Source Software, by serving as a global certification hub. Founded in 2016, OUTCERT has positioned itself as the Certification Hub.

Born in Israel but now residing in Singapore, Lital says that she was born armed with an entrepreneurial mindset. Eventually, she took that mindset to Heriot-Watt University, in Glasgow, Scotland, where she earned her MBA. She has a background in Marketing and Business consultancy, and for the last 6 years, she has also been the CEO of LSI Business Strategy & Marketing Agency, based in Singapore, a company she founded.

In parallel, and as an entrepreneur, she recognised the high potential in EduTech and loved the idea of OUTCERT's objectives and vision. "I am a big believer in lifelong learning, for the self, and professional development," she says. "I see the future in this, and I think OUTCERT is going to be one of the important leading platforms for leveraging tech educational development."

"I started as a CMO with OUTCERT, and along with the team, helped build all the foundations of the company, including marketing and business development opportunities. But then, after 2.5 years, we saw the opportunity of me stepping in from the inside as the new CEO and a co-founder.  So at the moment, I am putting in all my efforts to push OUTCERT forward, and to focus on the incredible potential and opportunities we have created over the years. Now, the growth intensive phase is knocking on our door! Lot's of things going; we are thrilled and looking forward!"

The platform at outcert.com is free to use with free registration. If you're already on LinkedIn, you can even sign up with your LinkedIn account. Once you register, the OUTCERT platform will ask you a short series of questions. I went through the process myself, just to see what a student might encounter, so I'll just point out that while that Q&A session is short, basically just three questions, the choices are many.

Those questions are about the certification areas that interest you, certifications you may already have, and then will ask you about the technology areas that interest you (e.g. machine learning, Linux, cloud security, etc). It will then create a dashboard like profile page, from which you can narrow down your interactions with all of these. Given the dizzying number of organizations, technologies, and certification options, that dashboard will be a welcome sight.

LPI Study Materials, LPI Guides, LPI Learning, LPI Tutorial and Material, Dell EMC Certifications, LPI Online Exam

Simplification itself is the whole idea behind OUTCERT. Lital points out that, "our platform simplifies the search for certifications in over 100 technology areas and creates an engaging roadmap of one’s learning way into – and throughout – their career. We want to practice open source in the way we do our marketing, in the way we share knowledge, in the capabilities we offer, so that students can concentrate on their careers and learning paths."

As for that learning, she explains, "We live in the age of the infinite learning and getting certified is part of being an infinite learner." 

The whole process is stressful enough and contemplating infinity even more so. Lital jokes, "Maybe it's time to rebrand certifications."

To begin your own journey, head over to outcert.com, register, and you'll be on your way.

Sunday, 8 December 2019

Exam Profile: CompTIA Linux+ (LX0-103 and LX0-104) and LPIC-1 (101-400 and 102-400)

The Linux Professional Institute Certification (LPIC) has been around since 1999 and is the oldest available vendor-neutral Linux certification. It has always been targeted at the junior Linux user with about a year of experience, and it covers a variety of basic topics from planning an installation to basic service configuration.

CompTIA Study Materials, CompTIA Tutorial and Material, CompTIA Learning, CompTIA Certifications, CompTIA Online Exam, CompTIA Guides

The main advantage of LPIC over other certifications is that it's vendor-neutral. You're expected to have a breadth of knowledge about various Linux systems, and you're not tested on the intricacies of one system or another. This approach keeps your options open when presenting the certification to a potential employer.

Successful completion of both LPIC-1 exams (101 and 102) is required to obtain the LPIC level 1 certification. The topics for these exams have been updated recently, with the latest version released in February 2015. This version of the exam introduces new topics such as databases and email server basics.

These exams are also offered as CompTIA's Linux+ certification. Linux+ has been “powered by LPI” (the Linux Professional Institute) since 2010, with the CompTIA and LPI exams being taken from the same pool of LPI questions. This partnership allows you to take the same exam through CompTIA under the LX0-103 and LX0-104 names to obtain Linux+ certification. Passing either LPIC level 1 or Linux+ will also earn you a SUSE Certified Linux Administrator certification, if you want to claim it.

Caution

LPI grants you the LPIC level 1 certification if you pass the Linux+ exams, but the reverse does not hold true.

The first exam focuses on basic Linux concepts such as package management, commands, and devices. Although this is a Linux test, it covers hardware concepts, especially pertaining to the way systems boot. For package management, you're expected to know about both the Red Hat and Debian style of packages and associated command-line tools. The Linux Filesystem Hierarchy Standard also features heavily in this exam.

The second exam gets more specifically into applications, scripting, and security. You should know all about the different files that the shell uses and how to customize the shell. You should know about user management, writing scripts, and scheduling those scripts to run unattended. You also need to know very basic information about email servers, logging, time servers, and printing.

Exam Details


Number of questions: 60 per exam.

Types of questions: Multiple choice with 4–5 options (single or multiple answers) and fill-in-the-blank questions. Mostly straightforward questions, but expect items that ask you to read an exhibit and answer a question.

Passing score: 500 (from a scale of 200–800).

Time limit: 90 minutes.

How to register: For LPI exams, start at lpi.org to get a member ID and a link to LPICentral.blogspot.com/p/lpi-certifications to schedule an exam. For the Linux+ variant, buy directly from CompTIA.

Trouble Spots


Whether you take them via Linux+ (103/104) or LPIC-1 (101/102), some aspects of these two exams cause problems for candidates: First is the breadth of the material, and second is the format of some of the questions.

The Linux+ / LPIC level 1 certification covers a great deal of material and at times expects you to remember specific details. For example, you know that the ls command lists files and directories, but the question might ask which flag shows the files in order of last modification. This type of question greatly expands the information you need to know. Most of the questions can be considered fair game for an exam at this level, so it's reasonable to expect someone to know this. The trouble comes when you're under the pressure of an exam rather than in the context of a work situation, where you have system documentation at your fingertips.

These exams cover both Debian and Red Hat package management, and some of the questions are quite detailed. If you normally use one style and not the other, spend some extra time getting familiar with the one you use less frequently.

The other trouble spot is the questions themselves. The fill-in-the-blank questions are difficult because you don't have some possible answers to jog your memory. Fortunately, there aren't too many of these questions.

Pay careful attention to the wording of each question. For example, the fill-in-the-blank questions specify whether the answer includes the path, and missing that could mean the difference between a correct answer and an incorrect answer. The multiple-choice questions and answers also need careful parsing. Many Linux flags are named after what they do, and questions often describe the feature in a different way than expected. You might expect “Which flag to ls shows the output in long format?” (-l is the correct answer.) Instead, you might get a question like “Which flag to ls outputs files including their size and directory permissions?”

Preparation Hints


With the variety of topics on this exam, the best way to study is to practice on real Linux systems—two, at least, one using RPM packages and one using DEB packages. You need to be familiar with the basic commands and how the system starts up and shuts down, all the way from BIOS to the initialization scripts.

Ideally, you would gain this experience on the job, but if that's not possible you can install Linux on spare hardware at home, or use virtualization technology such as VirtualBox. Set up a system that has different users and practice managing files—learn how to share files between users, and how to keep users separate. Install, configure, and remove software. At this level, the focus is on the commands to manage software packages, so the exact software doesn't matter.

It's also important that you have a good guide to lead you through the material, such as a study guide, and the official topic list. You could be learning thousands of commands; make sure you spend your time learning the right ones.

Exam Topics for CompTIA Linux+ (LX0-103) and LPIC-1 (101-400)


Topic 101: System Architecture


101.1 - Determine and configure hardware settings.

101.2 - Boot the system.

101.3 - Change runlevels / boot targets and shutdown or reboot system.

Topic 102: Linux Installation and Package Management


102.1 - Design hard disk layout.

102.2 - Install a boot manager.

102.3 - Manage shared libraries.

102.4 - Use Debian package management.

102.5 - Use RPM and YUM package management.

Topic 103: GNU and Unix Commands


103.1 - Work on the command line.

103.2 - Process text streams using filters.

103.3 - Perform basic file management.

103.4 - Use streams, pipes, and redirects.

103.5 - Create, monitor, and kill processes.

103.6 - Modify process-execution priorities.

103.7 - Search text files using regular expressions.

103.8 - Perform basic file-editing operations using vi.

Topic 104: Devices, Linux Filesystems, Filesystem Hierarchy Standard


104.1 - Create partitions and filesystems.

104.2 - Maintain the integrity of filesystems.

104.3 - Control mounting and unmounting of filesystems.

104.4 - Manage disk quotas.

104.5 - Manage file permissions and ownership.

104.6 - Create and change hard and symbolic links.

104.7 - Find system files and place files in the correct location.

Exam Topics for CompTIA Linux+ (LX0-104) and LPIC-1 (102-400)


Topic 105: Shells, Scripting, and Data Management


105.1 - Customize and use the shell environment.

105.2 - Customize or write simple scripts.

105.3 - SQL data management.

Topic 106: User Interfaces and Desktops


106.1 - Install and configure X11.

106.2 - Set up a display manager.

106.3 - Accessibility.

Topic 107: Administrative Tasks


107.1 - Manage user and group accounts and related system files.

107.2 - Automate system administration tasks by scheduling jobs.

107.3 - Localization and internationalization.

Topic 108: Essential System Services


108.1 - Maintain system time.

108.2 - System logging.

108.3 - Mail Transfer Agent (MTA) basics.

108.4 - Manage printers and printing.

Topic 109: Networking Fundamentals


109.1 - Fundamentals of Internet protocols.

109.2 - Basic network configuration.

109.3 - Basic network troubleshooting.

109.4 - Configure client-side DNS.

Topic 110: Security


110.1 - Perform security administration tasks.

110.2 - Set up host security.

110.3 - Securing data with encryption.

Saturday, 7 December 2019

cmp Command in Linux with examples

cmp command in Linux/UNIX is used to compare the two files byte by byte and helps you to find out whether the two files are identical or not.

◈ When cmp is used for comparison between two files, it reports the location of the first mismatch to the screen if difference is found and if no difference is found i.e the files compared are identical.

◈ cmp displays no message and simply returns the prompt if the the files compared are identical.

Syntax:

cmp [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]

SKIP1 ,SKIP2 & OPTION are optional
and FILE1 & FILE2 refer to the filenames.

cmp Command, LPI Tutorial and Material, LPI Guides, LPI Certification, LPI Linux

The syntax of cmp command is quite simple to understand. If we are comparing two files then obviously we will need their names as arguments (i.e as FILE1 & FILE2 in syntax). In addition to this, the optional SKIP1 and SKIP2 specify the number of bytes to skip at the beginning of each file which is zero by default and OPTION refers to the options compatible with this command about which we will discuss later on.

cmp Example : As explained that the cmp command reports the byte and line number if a difference is found. Now let’s find out the same with the help of an example. Suppose there are two files which you want to compare one is file1.txt and other is file2.txt :

$cmp file1.txt file2.txt

1. If the files are not identical: the output of the above command will be :

$cmp file1.txt file2.txt
file1.txt file2.txt differ: byte 9, line 2

 /*indicating that the first mismatch found in
 two files at byte 20 in second line*/

2. If the files are identical: you will see something like this on your screen:

$cmp file1.txt file2.txt
$ _
/*indicating that the files are identical*/

Options for cmp command


1. -b(print-bytes): If you want cmp displays the differing bytes in the output when used with -b option.

//...cmp command used with -b option...//

$cmp -b file1.txt file2.txt
file1.txt file2.txt differ: 12 byte, line 2 is 154 l 151 i

/* indicating that the difference is in 12
 byte ,which is 'l' in file1.txt and 'i' in file2.txt.*/

The values 154 and 151 in the above output are the values for these bytes, respectively.

2. -i [bytes-to-be-skipped]: Now, this option when used with cmp command helps to skip a particular number of initial bytes from both the files and then after skipping it compares the files. This can be done by specifying the number of bytes as argument to the -i command line option.

//...cmp command used with -i option...//

$cmp -i 10 file1.txt file2.txt
$_

/*indicating that both files are identical
after 10 bytes skipped from both the files*/

Note that in cases like these (where you use -i to skip bytes), the byte at which the comparison begins is treated as byte number zero.

3. -i [bytes to be skipped from first file]: [bytes to be skipped from second file] :This option is very much similar to the above -i [bytes to be skipped] option but with the difference that now it allows us to input the number of bytes we want to skip from both the files separately.

//...cmp command used with -i option...//

$cmp -i 10:12 file1.txt file2.txt
$_

/*indicating that both files are identical
after 10 bytes skipped from first file and
12 bytes skipped from second file*/

4. -l option: This option makes the cmp command print byte position and byte value for all differing bytes.

//...cmp command used with -l option...//

$cmp -l file1.txt file2.txt
20   12   56
21  124   12
22  150  124
23  151  150
24  163  151
25   40  163
26  146   40
27  150  151
28   12   24
29  124  145
30  157  163

/*indicating that files are different
displaying the position of differing
bytes along with the differing bytes
 in both file*/

The first column in the output represents the position (byte number) of differing bytes. The second column represents the byte value of the differing byte in the first file, while the third column represents the byte value of the differing byte in the second file.

5. -s option: This allows you to suppress the output normally produced by cmp command i.e it compares two files without writing any messages. This gives an exit value of 0 if the files are identical, a value of 1 if different, or a value of 2 if an error message occurs.

//...cmp command used with -s option...//

$cmp -s file1.txt file.txt
1

/*indicating files are different without
displaying the differing byte and line*/

6. -n [number of bytes to be compared] option: This option allows you to limit the number of bytes you want to compare ,like if there is only need to compare at most 25 or 50 bytes.

//...cmp command used with -n option...//

$cmp -n 50 file1.txt file2.txt
$_

/*indicating files are identical for starting
50 bytes*/

8. – -v option: This gives the output information and exits.

9. – -help option: This displays a help message and exits.

Thursday, 5 December 2019

Grep Command In Unix/Linux With Simple Examples

Grep Command, Linux Tutorial and Material, Linux Certification, LPI Online Exam

Grep command in Unix/Linux is the short form of ‘global search for the regular expression’.

The grep command is a filter that is used to search for lines matching a specified pattern and print the matching lines to standard output.

Grep Command in Unix with Examples


Syntax:

grep [options] [pattern] [file]

The pattern is specified as a regular expression. A regular expression is a string of characters that is used to specify a pattern matching rule. Special characters are used to define the matching rules and positions.

#1) Anchor Characters: ‘^’ and ‘$’ at the beginning and end of the pattern are used to anchor the pattern to the start of the line, and to the end of the line respectively.

Example: “^Name” matches all lines that start with the string “Name”. The strings “\<” and “\>” are used to anchor the pattern to the start and end of a word respectively.

#2) Wildcard Character: ‘.’ Is used to match any character.

Example:“^.$” will match all lines with any single character.

#3) Escaped Characters: Any of the special characters can be matched as a regular character by escaping them with a ‘\’.

Example: “\$\*” will match the lines that contain the string “$*”

#4) Character Range: A set of characters enclosed in a ‘[‘ and ‘]’ pair specify a range of characters to be matched.

Example: “[aeiou]” will match all lines that contain a vowel. A hyphen can be used while specifying a range to shorten a set of consecutive characters. E.g. “[0-9]” will match all lines that contain a digit. A carat can be used at the beginning of the range to specify a negative range. E.g. “[^xyz]” will match all lines that do not contain x, y or z.

#5) Repetition Modifier: A ‘*’ after a character or group of characters is used to allow matching zero or more instances of the preceding pattern.

The grep command supports a number of options for additional controls on the matching:

◉ -i: performs a case-insensitive search.
◉ -n: displays the lines containing the pattern along with the line numbers.
◉ -v: displays the lines not containing the specified pattern.
◉ -c: displays the count of the matching patterns.

Examples:

◉ Match all lines that start with ‘hello’. E.g: “hello there”

$ grep “^hello” file1

◉ Match all lines that end with ‘done’. E.g: “well done”

$ grep “done$” file1

◉ Match all lines that contain any of the letters ‘a’, ‘b’, ‘c’, ‘d’ or ‘e’.

$ grep “[a-e]” file1

◉ Match all lines that do not contain a vowel

$ grep “[^aeiou]” file1

◉ Match all lines that start with a digit following zero or more spaces. E.g: “ 1.” or “2.”

$ grep “ *[0-9]” file1

◉ Match all lines that contain the word hello in upper-case or lower-case

$ grep -i “hello”

Sunday, 1 December 2019

Top 60 Linux Interview Questions & Answers

LPI Study Materials, LPI Guides, LPI Tutorial and Material, LPI Certifications, LPI Learning, LPI Online Exam

1) What is Linux?


Linux is an operating system based on UNIX and was first introduced by Linus Torvalds. It is based on the Linux Kernel and can run on different hardware platforms manufactured by Intel, MIPS, HP, IBM, SPARC, and Motorola. Another popular element in Linux is its mascot, a penguin figure named Tux.

2) What is the difference between UNIX and LINUX?


Unix originally began as a propriety operating system from Bell Laboratories, which later on spawned into different commercial versions. On the other hand, Linux is free, open source and intended as a non-propriety operating system for the masses.

3) What is BASH?


BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the original Bourne Shell (represented by /bin/sh). It combines all the features from the original version of Bourne Shell, plus additional functions to make it easier and more convenient to use. It has since been adapted as the default shell for most systems running Linux.

4) What is Linux Kernel?


The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user. It is also used to provide an interface for user-level interaction.

5) What is LILO?


LILO is a boot loader for Linux. It is used mainly to load the Linux operating system into main memory so that it can begin its operations.

6) What is a swap space?


Swap space is a certain amount of space used by Linux to temporarily hold some programs that are running concurrently. This happens when RAM does not have enough memory to hold all programs that are executing.

7) What is the advantage of open source?


Open source allows you to distribute your software, including source codes freely to anyone who is interested. People would then be able to add features and even debug and correct errors that are in the source code. They can even make it run better and then redistribute these enhanced source code freely again. This eventually benefits everyone in the community.

8 ) What are the basic components of Linux?


Just like any other typical operating system, Linux has all of these components: kernel, shells and GUIs, system utilities, and an application program. What makes Linux advantageous over other operating system is that every aspect comes with additional features and all codes for these are downloadable for free.

9) Does it help for a Linux system to have multiple desktop environments installed?


In general, one desktop environment, like KDE or Gnome, is good enough to operate without issues. It's all a matter of preference for the user, although the system allows switching from one environment to another. Some programs will work in one environment and not work on the other, so it could also be considered a factor in selecting which environment to use.

10) What is the basic difference between BASH and DOS?


The key differences between the BASH and DOS console lie in 3 areas:

- BASH commands are case sensitive while DOS commands are not;

- Under BASH, / character is a directory separator and \ acts as an escape character. Under DOS, / serves as a command argument delimiter and \ is the directory separator

- DOS follows a convention in naming files, which is 8 character file name followed by a dot and 3 characters for the extension. BASH follows no such convention.

11) What is the importance of the GNU project?


This so-called Free software movement allows several advantages, such as the freedom to run programs for any purpose and freedom to study and modify a program to your needs. It also allows you to redistribute copies of software to other people, as well as the freedom to improve software and have it released for the public.

12) Describe the root account.


The root account is like a systems administrator account and allows you full control of the system. Here you can create and maintain user accounts, assigning different permissions for each account. It is the default account every time you install Linux.

13) What is CLI?


CLI is short for Command Line Interface. This interface allows the user to type declarative commands to instruct the computer to perform operations. CLI offers greater flexibility. However, other users who are already accustomed to using GUI find it difficult to remember commands including attributes that come with it.

14) What is GUI?


GUI, or Graphical User Interface, make use of images and icons that users click and manipulate as a way of communicating with the computer. Instead of having to remember and type commands, the use of graphical elements makes it easier to interact with the system, as well as adding more attraction through images, icons, and colors.

15) How do you open a command prompt when issuing a command?


To open the default shell (which is where the command prompt can be found), press Ctrl-Alt-F1. This will provide a command line interface (CLI) from which you can run commands as needed.

16) How can you find out how much memory Linux is using?


From a command shell, use the "concatenate" command: cat /proc/meminfo for memory usage information. You should see a line starting something like Mem: 64655360, etc. This is the total memory Linux thinks it has available to use.

You can also use commands

free - m

vmstat

top

htop

to find current memory usage

17) What is a typical size for a swap partition under a Linux system?


The preferred size for a swap partition is twice the amount of physical memory available on the system. If this is not possible, then the minimum size should be the same as the amount of memory installed.

18) What are symbolic links?


Symbolic links act similarly to shortcuts in Windows. Such links point to programs, files or directories. It also allows you instant access to it without having to go directly to the entire pathname.

19) Does the Ctrl+Alt+Del key combination work on Linux?


Yes, it does. Just like Windows, you can use this key combination to perform a system restart. One difference is that you won't be getting any confirmation message and therefore, a reboot is immediate.

20) How do you refer to the parallel port where devices such as printers are connected?


Whereas under Windows you refer to the parallel port as the LPT port, under Linux you refer to it as /dev/lp . LPT1, LPT2 and LPT3 would therefore be referred to as /dev/lp0, /dev/lp1, or /dev/lp2 under Linux.

21) Are drives such as hard drive and floppy drives represented with drive letters?


No. In Linux, each drive and device have different designations. For example, floppy drives are referred to as /dev/fd0 and /dev/fd1. IDE/EIDE hard drives are referred to as /dev/hda, /dev/hdb, /dev/hdc, and so forth.

22) How do you change permissions under Linux?


Assuming you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or – symbol to deny permission, along with any of the following letters: u (user), g (group), o (others), a (all), r (read), w (write) and x (execute). For example, the command chmod go+rw FILE1.TXT grants read and write access to the file FILE1.TXT, which is assigned to groups and others.

23) In Linux, what names are assigned to the different serial ports?


Serial ports are identified as /dev/ttyS0 to /dev/ttyS7. These are the equivalent names of COM1 to COM8 in Windows.

24) How do you access partitions under Linux?


Linux assigns numbers at the end of the drive identifier. For example, if the first IDE hard drive had three primary partitions, they would be named/numbered, /dev/hda1, /dev/hda2 and /dev/hda3.

25) What are hard links?


Hard links point directly to the physical file on disk, and not on the pathname. This means that if you rename or move the original file, the link will not break since the link is for the file itself, not the path where the file is located.

26) What is the maximum length for a filename under Linux?


Any filename can have a maximum of 255 characters. This limit does not include the path name, so therefore the entire pathname and filename could well exceed 255 characters.

27)What are filenames that are preceded by a dot?


In general, filenames that are preceded by a dot are hidden files. These files can be configuration files that hold important data or setup info. Setting these files as hidden makes it less likely to be accidentally deleted.

28) Explain virtual desktop.


This serves as an alternative to minimizing and maximizing different windows on the current desktop. Using virtual desktops can clear the desktop when you can open one or more programs. Rather than minimizing/restoring all those programs as needed, you can simply shuffle between virtual desktops with programs intact in each one.

29) How do you share a program across different virtual desktops under Linux?


To share a program across different virtual desktops, in the upper left-hand corner of a program window look for an icon that looks like a pushpin. Pressing this button will "pin" that application in place, making it appear in all virtual desktops, in the same position onscreen.

30) What does a nameless (empty) directory represent?


This empty directory name serves as the nameless base of the Linux file system. This serves as an attachment for all other directories, files, drives, and devices.

31) What is the pwd command?


The pwd command is short for print working directory command.

Example:

pwd

Output:

/home/guru99/myDir


32) What are daemons?



Daemons are services that provide several functions that may not be available under the base operating system. Its main task is to listen for service request and at the same time to act on these requests. After the service is done, it is then disconnected and waits for further requests.

33) How do you switch from one desktop environment to another, such as switching from KDE to Gnome?


Assuming you have these two environments installed, just log out from the graphical interface. Then at the login screen, type your login ID and password and choose which session type you wish to load. This choice will remain your default until you change it to something else.

34) What are the kinds of permissions under Linux?


There are 3 kinds of permissions under Linux:- Read: users may read the files or list the directory- Write: users may write to the file of new files to the directory- Execute: users may run the file or lookup a specific file within a directory

35) How does case sensitivity affect the way you use commands?


When we talk about case sensitivity, commands are considered identical only if every character is encoded as is, including lowercase and uppercase letters. This means that CD, cd, and Cd are three different commands. Entering a command using uppercase letters, where it should be in lowercase, will produce different outputs.

36) What are environmental variables?


Environmental variables are global settings that control the shell's function as well as that of other Linux programs. Another common term for environmental variables is global shell variables.

37) What are the different modes when using vi editor?


There are 3 modes under vi:- Command mode – this is the mode where you start in- Edit mode – this is the mode that allows you to do text editing- Ex mode – this is the mode wherein you interact with vi with instructions to process a file

38) Is it possible to use shortcuts for a long pathname?


Yes, there is. A feature known as filename expansion allows you do this using the TAB key. For example, if you have a path named /home/iceman/assignments directory, you would type as follows: /ho[tab]/ice[tab]/assi[tab] . This, however, assumes that the path is unique and that the shell you're using supports this feature.

39) What is redirection?


Redirection is the process of directing data from one output to another. It can also be used to direct an output as an input to another process.

40) What is grep command?


grep a search command that makes use of pattern-based searching. It makes use of options and parameters that are specified along with the command line and applies this pattern in searching the required file output.

41) What could be the problem when a command that was issued gave a different result from the last time it was used?


One highly possible reason for getting different results from what seems to be the same command has something to do with case sensitivity issues. Since Linux is case sensitive, a command that was previously used might have been entered in a different format from the present one. For example, to lists all files in the directory, you should type the command ls, and not LS. Typing LS will either result in an error message if there is no program by that exact name exist or may produce a different output if there is a program named LS that performs another function.

42) What are the contents of /usr/local?


It contains locally installed files. This directory matters in environments where files are stored on the network. Specifically, locally-installed files go to /usr/local/bin, /usr/local/lib, etc.). Another application of this directory is that it is used for software packages installed from source, or software not officially shipped with the distribution.

43) How do you terminate an ongoing process?


Every process in the system is identified by a unique process id or pid. Use the kill command followed by the pid to terminate that process. To terminate all process at once, use kill 0.

44) How do you insert comments in the command line prompt?


Comments are created by typing the # symbol before the actual comment text. This tells the shell to completely ignore what follows. For example "# This is just a comment that the shell will ignore."

45) What is command grouping and how does it work?


You can use parentheses to group commands. For example, if you want to send the current date and time along with the contents of a file named OUTPUT to a second file named MYDATES, you can apply command grouping as follows: (date cat OUTPUT) > MYDATES

46) How do you execute more than one command or program from a single command line entry?


You can combine several commands by separating each command or program using a semicolon symbol. For example, you can issue such a series of commands in a single entry:

ls –l cd .. ls –a MYWORK which is equivalent to 3 commands: ls -l cd.. ls -a MYWORK
**Note that this will be executed one after the other, in the order specified.

47) Write a command that will look for files with an extension "c", and has the occurrence of the string "apple" in it.


Answer:

 Find ./ -name "*.c" | xargs grep –i "apple"


48) Write a command that will display all .txt files, including its individual permission.



Answer:

ls -al *.txt


49) Write a command that will do the following:



-look for all files in the current and subsequent directories with an extension c,v
-strip the,v from the result (you can use sed command)
-use the result and use a grep command to search for all occurrences of the word ORANGE in the files.

Find ./ -name "*.c,v" | sed 's/,v//g' | xargs grep "ORANGE"


50) What, if anything, is wrong with each of the following commands?



a) ls -l-s
b) cat file1, file2
c) ls - s Factdir

Answers:
a) there should be space between the 2 options: ls -l -s
b) do not use commas to separate arguments: cat file1 file2
c) there should be no space between hyphen and option label: ls –s Factdir

51) What is the command to calculate the size of a folder?


To calculate the size of a folder uses the command du –sh folder1.

52) How can you find the status of a process?


Use the command

ps ux

53) How can you check the memory status?


You can use the command

free -m to display output in MB

free -g to display output in GB

54) Explain how to color the Git console?


To color the Git console, you can use the command git config—global color.ui auto. In the command, the color.ui variable sets the default value for a variable such as color.diff and color.grep.

55) How can you append one file to another in Linux?


To append one file to another in Linux you can use command cat file2 >> file 1. The operator >> appends the output of the named file or creates the file if it is not created. While another command cat file 1 file 2 > file 3 appends two or more files to one.

56) Explain how you can find a file using Terminal?


To find a file you have to use a command, find . –name "process.txt" . It will look for the current directory for a file called process.txt.

57) Explain how you can create a folder using Terminal?


To create a folder, you have to use command mkdir. It will be something like these: ~$ mkdir Guru99

58) Explain how you can view the text file using Terminal?


To view the text file, go to the specific folder where the text files are located by using the command cd and then type less filename.txt.

59) Explain how to enable curl on Ubuntu LAMP stack?


To enable curl on Ubuntu, first, install libcurl, once done use following command sudo/etc/init .d /apache2 restart or sudo service apache2 restart.

60) Explain how to enable root logging in Ubuntu?


The command which enables root logging is

#sudo sh-c 'echo "greater-show-manual-login=true" >>/etc/lightdm/lightdm.conf'

61) How can you run a Linux program in the background simultaneously when you start your Linux Server?


By using nohup. It will stop the process receiving the NOHUP signal and thus terminating it you log out of the program which was invoked with. & runs the process in the background.

62) Explain how to uninstall the libraries in Linux?


To uninstall the libraries in Linux, you can use command sudo apt-get remove library_name

Saturday, 30 November 2019

LPIC-3 Exam 303: Security

LPIC-3, LPI Security, LPI Study Material, LPI Tutorial and Material, LPI Guides

The LPIC-3 certification is the culmination of LPI’s multi-level professional certification program. LPIC-3 is designed for the enterprise-level Linux professional and represents the highest level of professional, distribution-neutral Linux certification within the industry. Three separate LPIC-3 specialty certifications are available. Passing any one of the three exams will grant the LPIC-3 certification for that specialty.

The LPIC-3 303: Security certification covers the administration of Linux systems enterprise-wide with an emphasis on security.

Exam Objectives Version: Version 2.0

Exam Code: 303-200

About Objective Weights: Each objective is assigned a weighting value. The weights indicate the relative importance of each objective on the exam. Objectives with higher weights will be covered in the exam with more questions.

Topic 325: Cryptography


325.1 X.509 Certificates and Public Key Infrastructures

Weight: 5

Description: Candidates should understand X.509 certificates and public key infrastructures. They should know how to configure and use OpenSSL to implement certification authorities and issue SSL certificates for various purposes.

Key Knowledge Areas:

◈ Understand X.509 certificates, X.509 certificate lifecycle, X.509 certificate fields and X.509v3 certificate extensions
◈ Understand trust chains and public key infrastructures
◈ Generate and manage public and private keys
◈ Create, operate and secure a certification authority
◈ Request, sign and manage server and client certificates
◈ Revoke certificates and certification authorities

The following is a partial list of the used files, terms and utilities:

◈ openssl, including relevant subcommands
◈ OpenSSL configuration
◈ PEM, DER, PKCS
◈ CSR
◈ CRL
◈ OCSP

325.2 X.509 Certificates for Encryption, Signing and Authentication

Weight: 4

Description: Candidates should know how to use X.509 certificates for both server and client authentication. Candidates should be able to implement user and server authentication for Apache HTTPD. The version of Apache HTTPD covered is 2.4 or higher.

Key Knowledge Areas:

◈ Understand SSL, TLS and protocol versions
◈ Understand common transport layer security threats, for example Man-in-the-Middle
◈ Configure Apache HTTPD with mod_ssl to provide HTTPS service, including SNI and HSTS
◈ Configure Apache HTTPD with mod_ssl to authenticate users using certificates
◈ Configure Apache HTTPD with mod_ssl to provide OCSP stapling
◈ Use OpenSSL for SSL/TLS client and server tests

Terms and Utilities:

◈ Intermediate certification authorities
◈ Cipher configuration (no cipher-specific knowledge)
◈ httpd.conf
◈ mod_ssl
◈ openssl

325.3 Encrypted File Systems

Weight: 3

Description: Candidates should be able to setup and configure encrypted file systems.

Key Knowledge Areas:

◈ Understand block device and file system encryption
◈ Use dm-crypt with LUKS to encrypt block devices
◈ Use eCryptfs to encrypt file systems, including home directories and
◈ PAM integration
◈ Be aware of plain dm-crypt and EncFS

Terms and Utilities:

◈ cryptsetup
◈ cryptmount
◈ /etc/crypttab
◈ ecryptfsd
◈ ecryptfs-* commands
◈ mount.ecryptfs, umount.ecryptfs
◈ pam_ecryptfs

325.4 DNS and Cryptography

Weight: 5

Description: Candidates should have experience and knowledge of cryptography in the context of DNS and its implementation using BIND. The version of BIND covered is 9.7 or higher.

Key Knowledge Areas:

◈ Understanding of DNSSEC and DANE
◈ Configure and troubleshoot BIND as an authoritative name server serving DNSSEC secured zones
◈ Configure BIND as an recursive name server that performs DNSSEC validation on behalf of its clients
◈ Key Signing Key, Zone Signing Key, Key Tag
◈ Key generation, key storage, key management and key rollover
◈ Maintenance and re-signing of zones
◈ Use DANE to publish X.509 certificate information in DNS
◈ Use TSIG for secure communication with BIND

Terms and Utilities:

◈ DNS, EDNS, Zones, Resource Records
◈ DNS resource records: DS, DNSKEY, RRSIG, NSEC, NSEC3, NSEC3PARAM, TLSA
◈ DO-Bit, AD-Bit
◈ TSIG
◈ named.conf
◈ dnssec-keygen
◈ dnssec-signzone
◈ dnssec-settime
◈ dnssec-dsfromkey
◈ rndc
◈ dig
◈ delv
◈ openssl

Topic 326: Host Security


326.1 Host Hardening

Weight: 3

Description: Candidates should be able to secure computers running Linux against common threats. This includes kernel and software configuration.

Key Knowledge Areas:

◈ Configure BIOS and boot loader (GRUB 2) security
◈ Disable useless software and services
◈ Use sysctl for security related kernel configuration, particularly ASLR, Exec-Shield and IP / ICMP configuration
◈ Exec-Shield and IP / ICMP configuration
◈ Limit resource usage
◈ Work with chroot environments
◈ Drop unnecessary capabilities
◈ Be aware of the security advantages of virtualization

Terms and Utilities:

◈ grub.cfg
◈ chkconfig, systemctl
◈ ulimit
◈ /etc/security/limits.conf
◈ pam_limits.so
◈ chroot
◈ sysctl
◈ /etc/sysctl.conf

326.2 Host Intrusion Detection

Weight: 4

Description: Candidates should be familiar with the use and configuration of common host intrusion detection software. This includes updates and maintenance as well as automated host scans.

Key Knowledge Areas:

◈ Use and configure the Linux Audit system
◈ Use chkrootkit
◈ Use and configure rkhunter, including updates
◈ Use Linux Malware Detect
◈ Automate host scans using cron
◈ Configure and use AIDE, including rule management
◈ Be aware of OpenSCAP

Terms and Utilities:

◈ auditd
◈ auditctl
◈ ausearch, aureport
◈ auditd.conf
◈ auditd.rules
◈ pam_tty_audit.so
◈ chkrootkit
◈ rkhunter
◈ /etc/rkhunter.conf
◈ maldet
◈ conf.maldet
◈ aide
◈ /etc/aide/aide.conf

326.3 User Management and Authentication

Weight: 5

Description: Candidates should be familiar with management and authentication of user accounts. This includes configuration and use of NSS, PAM, SSSD and Kerberos for both local and remote directories and authentication mechanisms as well as enforcing a password policy.

Key Knowledge Areas:

◈ Understand and configure NSS
◈ Understand and configure PAM
◈ Enforce password complexity policies and periodic password changes
◈ Lock accounts automatically after failed login attempts
◈ Configure and use SSSD
◈ Configure NSS and PAM for use with SSSD
◈ Configure SSSD authentication against Active Directory, IPA, LDAP, Kerberos and local domains
◈ Kerberos and local domains
◈ Obtain and manage Kerberos tickets

Terms and Utilities:

◈ nsswitch.conf
◈ /etc/login.defs
◈ pam_cracklib.so
◈ chage
◈ pam_tally.so, pam_tally2.so
◈ faillog
◈ pam_sss.so
◈ sssd
◈ sssd.conf
◈ sss_* commands
◈ krb5.conf
◈ kinit, klist, kdestroy

326.4 FreeIPA Installation and Samba Integration

Weight: 4

Description: Candidates should be familiar with FreeIPA v4.x. This includes installation and maintenance of a server instance with a FreeIPA domain as well as integration of FreeIPA with Active Directory.

Key Knowledge Areas:

◈ Understand FreeIPA, including its architecture and components
◈ Understand system and configuration prerequisites for installing FreeIPA
◈ Install and manage a FreeIPA server and domain
◈ Understand and configure Active Directory replication and Kerberos cross-realm trusts
◈ Be aware of sudo, autofs, SSH and SELinux integration in FreeIPA

Terms and Utilities:

◈ 389 Directory Server, MIT Kerberos, Dogtag Certificate System, NTP, DNS, SSSD, certmonger
◈ ipa, including relevant subcommands
◈ ipa-server-install, ipa-client-install, ipa-replica-install
◈ ipa-replica-prepare, ipa-replica-manage

Topic 327: Access Control


327.1 Discretionary Access Control

Weight: 3

Description: Candidates are required to understand Discretionary Access Control and know how to implement it using Access Control Lists. Additionally, candidates are required to understand and know how to use Extended Attributes.

Key Knowledge Areas:

◈ Understand and manage file ownership and permissions, including SUID and SGID
◈ Understand and manage access control lists
◈ Understand and manage extended attributes and attribute classes

Terms and Utilities:

◈ getfacl
◈ setfacl
◈ getfattr
◈ setfattr

327.2 Mandatory Access Control

Weight: 4

Description: Candidates should be familiar with Mandatory Access Control systems for Linux. Specifically, candidates should have a thorough knowledge of SELinux. Also, candidates should be aware of other Mandatory Access Control systems for Linux. This includes major features of these systems but not configuration and use.

Key Knowledge Areas:

◈ Understand the concepts of TE, RBAC, MAC and DAC
◈ Configure, manage and use SELinux
◈ Be aware of AppArmor and Smack

Terms and Utilities:

◈ getenforce, setenforce, selinuxenabled
◈ getsebool, setsebool, togglesebool
◈ fixfiles, restorecon, setfiles
◈ newrole, runcon
◈ semanage
◈ sestatus, seinfo
◈ apol
◈ seaudit, seaudit-report, audit2why, audit2allow
◈ /etc/selinux/*

327.3 Network File Systems

Weight: 3

Description: Candidates should have experience and knowledge of security issues in use and configuration of NFSv4 clients and servers as well as CIFS client services. Earlier versions of NFS are not required knowledge.

Key Knowledge Areas:

◈ Understand NFSv4 security issues and improvements
◈ Configure NFSv4 server and clients
◈ Understand and configure NFSv4 authentication mechanisms (LIPKEY, SPKM, Kerberos)
◈ Understand and use NFSv4 pseudo file system
◈ Understand and use NFSv4 ACLs
◈ Configure CIFS clients
◈ Understand and use CIFS Unix Extensions
◈ Understand and configure CIFS security modes (NTLM, Kerberos)
◈ Understand and manage mapping and handling of CIFS ACLs and SIDs in a Linux system

Terms and Utilities:

◈ /etc/exports
◈ /etc/idmap.conf
◈ nfs4acl
◈ mount.cifs parameters related to ownership, permissions and security modes
winbind
◈ getcifsacl, setcifsacl

Topic 328: Network Security


328.1 Network Hardening

Weight: 4

Description: Candidates should be able to secure networks against common threats. This includes verification of the effectiveness of security measures.

Key Knowledge Areas:

◈ Configure FreeRADIUS to authenticate network nodes
◈ Use nmap to scan networks and hosts, including different scan methods
◈ Use Wireshark to analyze network traffic, including filters and statistics
◈ Identify and deal with rogue router advertisements and DHCP messages

Terms and Utilities:

◈ radiusd
◈ radmin
◈ radtest, radclient
◈ radlast, radwho
◈ radiusd.conf
◈ /etc/raddb/*
◈ nmap
◈ wireshark
◈ tshark
◈ tcpdump
◈ ndpmon

328.2 Network Intrusion Detection

Weight: 4

Description: Candidates should be familiar with the use and configuration of network security scanning, network monitoring and network intrusion detection software. This includes updating and maintaining the security scanners.

Key Knowledge Areas:

◈ Implement bandwidth usage monitoring
◈ Configure and use Snort, including rule management
◈ Configure and use OpenVAS, including NASL

Terms and Utilities:

◈ ntop
◈ Cacti
◈ snort
◈ snort-stat
◈ /etc/snort/*
◈ openvas-adduser, openvas-rmuser
◈ openvas-nvt-sync
◈ openvassd
◈ openvas-mkcert
◈ /etc/openvas/*

328.3 Packet Filtering

Weight: 5

Description: Candidates should be familiar with the use and configuration of packet filters. This includes netfilter, iptables and ip6tables as well as basic knowledge of nftables, nft and ebtables.

Key Knowledge Areas:

◈ Understand common firewall architectures, including DMZ
◈ Understand and use netfilter, iptables and ip6tables, including standard modules, tests and targets
◈ Implement packet filtering for both IPv4 and IPv6
◈ Implement connection tracking and network address translation
◈ Define IP sets and use them in netfilter rules
◈ Have basic knowledge of nftables and nft
◈ Have basic knowledge of ebtables
◈ Be aware of conntrackd

Terms and Utilities:

◈ iptables
◈ ip6tables
◈ iptables-save, iptables-restore
◈ ip6tables-save, ip6tables-restore
◈ ipset
◈ nft
◈ ebtables

328.4 Virtual Private Networks

Weight: 4

Description: Candidates should be familiar with the use of OpenVPN and IPsec.

Key Knowledge Areas:

◈ Configure and operate OpenVPN server and clients for both bridged and routed VPN networks
◈ Configure and operate IPsec server and clients for routed VPN networks using IPsec-Tools / racoon
◈ Awareness of L2TP

Terms and Utilities:

◈ /etc/openvpn/*
◈ openvpn server and client
◈ setkey
◈ /etc/ipsec-tools.conf
◈ /etc/racoon/racoon.conf