Linux Concept https://linuxconcept.com An Ultimate Linux Tutorial Guide Mon, 25 Nov 2019 17:34:26 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.4 https://linuxconcept.com/wp-content/uploads/2019/02/favicon-150x150.png Linux Concept https://linuxconcept.com 32 32 Install MariaDB on Red Hat 7 Operating System https://linuxconcept.com/install-mariadb-on-red-hat-7-operating-system/ https://linuxconcept.com/install-mariadb-on-red-hat-7-operating-system/#respond Mon, 25 Nov 2019 17:34:23 +0000 https://linuxconcept.com/?p=4858 MariaDB is the latest open source and popular relational database management system, compatible and replacement of MySQL.

The post Install MariaDB on Red Hat 7 Operating System appeared first on Linux Concept.

]]>

MariaDB is the latest open source and popular relational database management system, compatible and replacement of MySQL.

MariaDB developed with MySQL original developers and many people from the community.

The RHEL 7 Operating System release was replaced MySQL with MariaDB as the default database system.

In this tutorial article, we will show how to install MariaDB into Red Hat, but for any reason you want to install MySQL into your RHEL, you can check the How to install MySQL on Red Hat Enterprise Linux (RHEL) 7 tutorial.

If your required application does not have any specific database requirements, you should go with MariaDB, default database of RHEL 7 Operating System.

Prerequisites

Before starting the process of installing MariaDB, make sure you have a RHEL 7 running system and a user to login into the system with sudo privileges.

Install MariaDB on RHEL 7

The default RHEL 7 repository providing MariaDB version 5.5, it is not the latest version of MariaDB, but it is a stable release.

To install MariaDB into Red Hat 7, you need to follow the below process:

Step 1 – Install MariaDB

To install MariaDB 5.5 version into RHEL 7 by using the following Command

Step 2 – Start MariaDB Service

After installation of MariaDB, the service automatically started, but you can use below command for manually start the MariaDB service:

Step 3 – Enable MariaDB Service

You should enable the MariaDB service to make MariaDB service auto start on system startup, by using the following command:

Step 4 – Verify MariaDB

To verify the MariaDB service, you can check the status of the service by using the following command:

Step 5 – MariaDB Secure Installation

To secure the MariaDB installation like change root password, restrict root access to localhost, remove test database, etc. to perform this task, you should run this command:

Install Latest MariaDB on RHEL 7

The latest MariaDB server version 10.3 is not coming with default repository of RHEL 7. If you want to install the latest version of MariaDB into Red Hat 7 system, create MariaDB repository file to install the latest MariaDB directly from official repository of MariaDB packages.

Let’s start the installation process of MariaDB 10.3 into RHEL 7 by the following procedure:

Step 1 – Enable MariaDB Repository

To enable MariaDB repository into a Red Hat system, you need to create a repository file into “/etc/yum.repos.d/” directory, as you can see below, we have created MariaDB repository file with the name of “MariaDB.repo”, you should also create the same file into your system.

Step 2 – Install MariaDB Server and Client

After creating the repository file, you should update your system’s repository package list by using the following command:

Once the Red Hat package is updated, you can use the following command to install mariaDB Server and Client:

You may get below the screen to import MariaDB GPG key into the system:

You should type “Y” (yes) to allow to download the key file.

Step 3 – Enable and start the MariaDB Service

Once the installation of MariaDB completed, you should enable and start the service, as shown below:

Step 4 – Verify MariaDB installation

You can verify the MariaDB installation by checking the status of service using the following command:

Step 5 – MariaDB Secure Installation

After installation and running service need to make your MariaDB secure, and to perform the security operation need to execute “mysql_secure_instalaltion” script, as shown below:

This script will use to set the password for root, restrict root user to localhost, remove anonymous users, and remove test database, etc.

All step will appear on the screen with detailed, and you need to press “Y” as your answer to accept the security changes.

MariaDB connection from CLI

To connect MariaDB server using terminal or CLI with root user credential type the below command:

Now it will ask you to enter a password for the root user and press enter.

Once you logged in into MariaDB shell and you will get a screen like below:

Conclusion

In this acritical, we learned how to install MariaDB into Red Hat Enterprise Linux (RHEL) 7 system. We also learned to install MariaDB directly from MariaDB repository.

Now MariaDB is installed in your system successful, and you know how to connect with MariaDB shell to perform Database commands and operations.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Install MariaDB on Red Hat 7 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/install-mariadb-on-red-hat-7-operating-system/feed/ 0
15 Practical examples of curl command https://linuxconcept.com/15-practical-examples-of-curl-command/ https://linuxconcept.com/15-practical-examples-of-curl-command/#respond Fri, 15 Nov 2019 21:55:42 +0000 https://linuxconcept.com/?p=2220 The post 15 Practical examples of curl command appeared first on Linux Concept.

]]>

Curl is the most essential command-line tool in Linux / UNIX for transfer data to or from a server using various protocols.

Most common supported protocols to curl utility are HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, Telnet, LDAP, etc.

Curl has capabilities to transfer multiple files at once.

We can do many more thing using curl utility using various options.

Suggested Reading: Linux curl command help and examples

Examples of curl command:

Example 1: curl use to download a file

You can use to download files from internet protocol http, https, FTP, etc.

To download a file from the internet, you can use curl with an option “-o,” and it will download and save the file into your current working directory with the same name an in the remote server.

Example 2: curl use to download multiple file

You can also download multiple files using CURL using the same option “-o” with all files, as shown below:

Example 3: curl use to download multiple files from list

Sometimes you have a list of files to download from internet or remote servers; In this case, you can make a text file with the list of downloaded files and use the “xargs” with curl to download all files with a single command, as shown below:

Example 4: Resume download uncompleted file

The CURL support resume to download interrupted files. To use these functionalities, use the “-c” option with curl, as shown below:

Example 5: CURL use proxy

Sometimes you use the proxy to surf the internet, especially in office in that case also you can use the curl command to download the file. You can use CURL like below example to use the proxy network.

Example 6: HTTP Headers query

Use HTTP header query to get the additional information from the remote server along with the actual request.

To request HTTP headers using curl command, follow below command:

Example 7: CURL use to POST request with parameters

You can use the curl command to post request with URL and parameters.

For example, in below command, we pass firstname and lastname parameters with their values, to https://linuxconcept.com/info.php

Example 8: CURL use to download files from FTP server

You can also use the curl command to download a file from FTP server.

Here we download a file “curltips.tar.gz” from ftp://linuxconcept.com using curl command as shown below:

You can remove “-u username:password” from above command if your FTP server allows anonymous login, if not you should replace username and password with your credentials.

Example 9: CURL use to upload files to an FTP server

The curl command also use to upload a file on FTP server.

Here we use curl command to upload a file “myform.tar.gz” to ftp://linuxconcept.com, as shown below:

Example 10: CURL can specify User agent

The user agent is sent information along with the HTTP request. It is use to identify the user’s platform and client application which is used to request any server. Generally, this information represents a web browser as the web browser generates maximum http requests.

By using curl command, you can specify user agent who will send through https request, as shown below:

Example 11: CURL use to store website cookies

The curl command also helps you to view and store website cookies into a file.

For example, if you want to see the cookies of https://www.cnn.com which is get downloaded into your browser when you browse the site. You can use below command to store cookies information into file “cnncookies.txt” which you can view using the cat command.

Example 12: CURL use to send website cookies

You can use the store cookies retrieved in the last example in a subsequent request to the same site.

Example 13: Modify name resolution

Curl command helps us to test development or staging sites using name resolution before moving it on a production server.

For example, the local version of “linuxconcept.com” before publishing it live, you can make curl resolve https://www.linuxconcept.com to your localhost system, as shown below:

The above query to https://www.linuxconcept.com will tell curl to request the site from localhost instead of using DNS or /etc/hosts file.

Example 14: Limit download rate in CURL command

To use your network bandwidth with optimal utilization, you can limit the download rate while using curl command.

You can limit the download bandwidth with curl command, as shown below:

Example 15: Check the version of CURL

To check the version of curl utility in Linux use it with the option “-v” or “–version,” as shown below:

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post 15 Practical examples of curl command appeared first on Linux Concept.

]]>
https://linuxconcept.com/15-practical-examples-of-curl-command/feed/ 0
How to add swap space on Red Hat 7 Operating System https://linuxconcept.com/how-to-add-swap-space-on-red-hat-7-operating-system/ https://linuxconcept.com/how-to-add-swap-space-on-red-hat-7-operating-system/#respond Thu, 17 Oct 2019 14:25:12 +0000 https://linuxconcept.com/?p=4931 Swap space can be created into Linux system in two ways, one we can create a dedicated partition for swap or another one is created a swap file and use it as swap space.

The post How to add swap space on Red Hat 7 Operating System appeared first on Linux Concept.

]]>

The swap space is a unique space on the disk that is used by the system when Physical RAM is full. When a Linux machine runout the RAM. It use swap space to move inactive pages from RAM.

Swap space can be created into Linux system in two ways, one we can create a dedicated partition for swap or another one is created a swap file and use it as swap space.

Usually, when we are creating VPS with any provider like Digital Ocean, Linode, etc., we don’t have the swap partition into the server, in this case, we need to create swap file to use as swap space in server.

In this tutorial, we have explained all necessary steps to create and add swap space on Red Hat 7 machine.

Prerequisites

Before beginning with this tutorial, make sure you have RHEL 7 machine and a user to login into the system with sudo privileges.

Before creating a swap file, it is good to know swap file or swap partition is available into your system or not.

To check the swap space, you can use below command:

If the output of the above command is empty, it means your system doesn’t have swap space.

If your system has already configured swap space you will get output like below:

Currently using swap space

It is also possible to configure more than one swap space.

Create and add swap space on Red Hat 7

In this tutorial, we will add 1GB of swap space, if you want to create bigger swap space you can create by replacing 1G with any other size what you want.

To create a swap file, follow the below steps:

Step 1 – Create a file for swap

To create a file for swap space, use the “fallocate” command. Here we are creating 1GB swap file at /swapfile file. As shown below:

If in your system fallocate is not installed or you get a message like “fallocate failed: Operation not supported,” you can use below command to create swap file:

Step 2 – Change Permission

The swap file should only access by the root user; you can execute the below command to configure correct permission for “/swapfile.”

Step 3 – Create swap space

To create swap space, use the “mkswap” command, as shown below:

Create swap file in Red Hat 7

Step 4 – Activate swap space

To activate swap file use the “swapon” command, as shown below:

To activate swap space permanent by configuring file “/etc/fstab”:

Add following line into the file “/etc/fstab”:

Step 5 – Verify Swap space

To check the swap space is active or not, you can use “swapon” or “free” command, as shown below:

active swap space in Red Hat 7
Memory utilization on Red Hat 7

Configure Swappiness Value

Swappiness is the essential swap properties of Linux kernel, which is defined when the system will use swap space. Swappiness can have the value between 0 to 100, which is represent the percentage of RAM utilization, for example, if you set the value 20 for swappiness, it means the Linux kernel will use swap space when RAM is only 20 % available.

So, we can say the lower value of swappiness is to try to avoid the use of swap space.

The default value of swappiness is 30, which you can check by using the following command:

Default swappiness value

The default value (30) of swappiness is ok for the desktop system, but when you run the production system, try to set the lower value for production servers.

You can set the swappiness value by using “sysctl” command, for example, if you want to set the value of swappiness is 20 you should execute below command:

To change the value of swappiness permanently, you should change the parameter “vm.swappiness” into the “/etc/sysctl.conf” file and reboot the system.

Remove Swap File

To deactivate and remove the active swap space, follow the below steps:

Step 1 – Deactivate Swap Space

To deactivate swap space, you can use the “swapoff” command, as shown below:

Step 2 – Remove from /etc/fstab

Edit the “/etc/fstab” file and remove the line “/swapfile swap swap defaults 0 0” from the file and save

Step 3 – Delete swapfile file

You can delete the “/swapfile” file by using the rm command, as shown below:

Conclusion

Now you have learned how to create a swap space into the Red Hat Enterprise Linux (RHEL) 7 machine if it not configured or you want to create another swap space.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post How to add swap space on Red Hat 7 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/how-to-add-swap-space-on-red-hat-7-operating-system/feed/ 0
Linux MCQ-10: Managing Servers https://linuxconcept.com/linux-mcq-10-managing-servers/ https://linuxconcept.com/linux-mcq-10-managing-servers/#respond Sat, 05 Oct 2019 04:33:03 +0000 https://linuxconcept.com/?p=4833 The post Linux MCQ-10: Managing Servers appeared first on Linux Concept.

]]>

The assessment test is an excellent way to test yourself before starting to study. It gives you an idea of where you should start and why.

In an assessment test, test your current skills from beginning to advance lever for any subject or topic to check “what do you know and from where you should start learning?”

Here I have put some basic questions for Linux assessment, so you can test your Linux skill and choose right path for Linux Learning.

 

Questions

1.    Which of the following commands would you type to see if the mail service is functioning and view a backlog of old messages?

  1. postfix
  2. traceroute
  3. sendmail
  4. mailq

2.    Joe is editing an smb.conf file and spots the line print ok = yes in a share definition. He changes this line to read printable = Yes. What effect will this change have on the operation of the share?

  1. It converts a printer share into a file share.
  2. It converts a file share into a printer share
  3. It makes Samba report errors correctly when they occur
  4. None of the above

3.    What will be the effect of the following lines in a sendmail m4 configuration file?

MASQUERADE_AS(‘example.org’)

FEATURE(masquerade_envelope)

  1. Mail addressed to users in the example.org domain will be hidden from view until the postmaster can examine it.
  2. The server will change all domain name references in all e-mail headers to example.org, for both incoming and outgoing e-mail.
  3. Mail sent through the server will be identified as coming from example.org, but only if the mail’s return address omits a domain name.
  4. Mail sent through the server will be identified as coming from example.org, even if the user has set another address in a mail client.

4.    Why might you want to run SWAT?

  1. It provides name resolution using NetBIOS protocols.
  2. It provides Web-based GUI administration of a Samba server.
  3. It’s run from the inetd or xinetd super server, unlike many servers.
  4. It helps to find and correct bugs in a wide variety of servers.

5.    Which file might you edit to have mail addressed to gertrude redirected to gerty? [Select all that apply.]

  1. /var/spool/mail/gertrude
  2. newnames in /etc or /etc/mail
  3. aliases in /etc or /etc/mail
  4. .forward in gertrude’s home directory

6.    How many individual queries are involved in a full recursive DNS lookup?

  1. 1
  2. 3
  3. 7
  4. A variable number

7.   Your network’s Internet connection went down an hour ago and has only recently come back up. How would you check to see how many outgoing mail messages have been stuck on your local sendmail server because of this problem?

  1. Type sendmail –q.
  2. Type mailq.
  3. Type xmqueue and click the Queued Messages button.
  4. Log in as postmaster and type pqcheck.

8.    You compare two /etc/named.conf files and find that they differ in only one line. The first includes a line in the options section that reads forward first;, while the second contains a line that reads forward only;. Assuming the rest of the forwarding name server configurations in these files are correct, what is the effect of this small difference?

  1. The forward first; configuration performs a forwarding lookup and then does a full recursive lookup if the forwarding lookup fails; the forward only; configuration performs a forwarding lookup but never attempts a full recursive lookup.
  2. The forward first; configuration forwards DNS information to client before logging the data; the forward only; configuration forwards DNS information to clients without logging information on the lookup.
  3. The forward first; configuration does a forwarding lookup and checks the results against a full recursive lookup; the forward only; configuration performs a forwarding lookup but never attempts a full recursive lookup.
  4. None of the above; neither configuration is valid.

9.    What is the name of the protocol Apache uses to communicate with clients?

  1. The Patchy Server Protocol
  2. The Hypertext Transfer Protocol
  3. The file Transfer Protocol
  4. The Hypertext Markup Language

10.    In what file would you enter the following line to use a forwarding DNS server you’ve set up on 192.168.1.1?

nameserver 192.168.1.1

  1. /etc/named.conf
  2. /etc/nameservers.conf
  3. /etc/resolv.conf
  4. /etc/dnsrc

11.    In what directory will you find the files delivered by an Apache server to its clients?

  1. /var/www/htdocs
  2. /var/www/localhost/htdocs
  3. /var/apache/htmlfiles
  4. The location is not consistent across systems

12.    Under what circumstances should a forwarding-only name server be accessible to the Internet at large?

  1. Rarely on never
  2. Almost always
  3. Only when your domain already has two other DNS servers on the Internet
  4. Only when you use BIND 8.x or later

13.    What port should you block with a firewall if you want to limit access to a web server running on its standard port?

  1. TCP port 22
  2. TCP port 25
  3. TCP port 80
  4. TCP port 901

14.    Which servers might you consider retiring after activating an SSH server? [Select all that apply.]

  1. SMTP
  2. Telnet
  3. FTP
  4. NFS

15.    How does an NFS server determine who may access files it’s exporting?

  1. It uses the local file ownership and permission in conjunction with the client’s user authentication and a list of trusted client computers.
  2. It uses a password that’s sent in unencrypted form across the network.
  3. It uses a password that’s sent in encrypted form across the network.
  4. It uses the contents of individual user’s .rlogin files to determine which client computers may access a share.

16.    You find that the ssh_host_dsa_key file in /etc/ssh has 0666 (-rw-rw-rw) permissions. Your SSH server has been in operation for several months. Should you be concerned?

  1. Yes
  2. No
  3. Only if the ssh_host_dsa_key.pub file is also world-readable
  4. Only if you’re launching SSH from a super server

17.    What is the effect of the following line in /etc/fstab?

Share: /server     /mnt/samba       nfs        defaults       0  0

  1. It mounts the SMB/CIFS share called server from the server called share at /mnt/samba.
  2. It mounts the SMB/CIFS share called share from the server called server at /mnt/samba.
  3. It mounts the NFS export called share from the server called server at /mnt/samba.
  4. It mounts the NFS export called server from the server called share at /mnt/samba.

18.    For best SSH server security, how should you set the Protocol option in /etc/ssh/sshd_config?

  1. Protocol 1
  2. Protocol 2
  3. Protocol 1,2
  4. Protocol 2,1

19.    Which of the following parameters should you definitely check and, if necessary, adjust in the [global] secton of your smb.conf file when configuring Samba?

  1. path
  2. workgroup
  3. comment
  4. write list

20.    Why is it unwise to allow root to log on directly using SSH?

  1. Somebody with the root password but no other password could then break into the computer.
  2. The root password should never be sent over a network connection; allowing root logins in this way is inviting disaster.
  3. SSH stores all login information, including passwords, in a publicly readable file.
  4. When logged on using SSH, root’s commands can be easily intercepted and duplicated by undesirable elements.

Answers

1.   d

2.   c, d

3.   b

4.   c

5.   d

6.   d

7.   d

8.   c

9.   b, c

10.   b

11.   d

12.   b

13.   d

14.   a

15.   b

16.   b

17.   a

18.   a

19.   a

20.   a

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Linux MCQ-10: Managing Servers appeared first on Linux Concept.

]]>
https://linuxconcept.com/linux-mcq-10-managing-servers/feed/ 0
Install Java on Red Hat 7 Operating System https://linuxconcept.com/install-java-on-red-hat-7-operating-system/ https://linuxconcept.com/install-java-on-red-hat-7-operating-system/#respond Fri, 04 Oct 2019 04:02:10 +0000 https://linuxconcept.com/?p=4946 The post Install Java on Red Hat 7 Operating System appeared first on Linux Concept.

]]>

Java is the most popular programming language, use to build various type of applications like a desktop application, web application, mobile application, etc. In this article you will learn all the process to install Java on Red Hat 7 Operating system and also learn to install multiple java version and choose one default version of Java in Operating System.

The Java comes in two different packages, one is Java Runtime Environment (JRE), and another one is Java Development Kit (JDK).

When we need to run a Java-based application or java program, we need only Java Runtime Environment, but if you want to develop Java application, you need to Java Development Kit (JDK). JDK includes both JRE and debugging tools and development libraries.

Java also has two different flavors, one is Open JDK, and another one is Oracle Java, both have the same functionalities and capabilities, the only difference is Oracle Java has some more commercial features. The default Java flavor of Linux Operating System is OpenJDK.

If you are a little bit confuse to choose between OpenJDK and Oracle Java, you can stick with default OpenJDK available on RHEL 7.

In this tutorial article, we will walk through the Java installation process on RHEL 7 machine.

Prerequisites

Before continuing this tutorial, make sure you have RHEL 7 installed machine and a user to login into the system with sudo privileges.

OpenJDK Installation

Install OpenJDK 8 JDK

OpenJDK 8 is the most widely-used version of Java. If your application required old version 8 of Java, you could install it by using below command.

Install OpenJDK 8 JRE

If you only want to run a java application, you can install OpenJDK 8 JRE (Java Runtime Environment) by using the following command:

You can verify java installation by checking the version of installed Java, as shown below:

If OpenJDK installed you will get the output like below image:

Check Installed Java version in Red Hat 7 Operating System

Now OpenJDK 8 is installed successfully into your RHEL 7 machine.

Install OpenJDK 11 JDK

OpenJDK 11 is the latest version of Java; you can install it in your RHEL 7 machine by using the following command:

You can verify OpenJDK 11 installation by checking the version of installed java, as shown below:

If OpenJDK installed you will get output like below:

Check Installed Java version in Red Hat 7 Operating System

Install OpenJDK 11 JRE

To run the java application with the latest Java Runtime Environment, you should install OpenJDK 11 JRE by using the following command:

Oracle Java Installation

First, you should be aware of the Oracle Java Licence; it is free only for non-commercial use of the software like development and personal use.

You can download Oracle Java from the official website. You should download Oracle Java “.rpm” packages from the Java SE Downloads page. To download Oracle Java, you have to register on the oracle site.

After downloading “.rpm” package for Oracle Java, You can install it on RHEL 7 by using the following command:

To execute above command first need to download java from official website and use the same rpm file in localinstall command as shown above.

Java default version Setup

If you have installed multiple Java into your RHEL 7 machine, you can check the default version of Java by checking the version, as shown below:

The output of the above command will look like below image:

Check Installed Java version in Red Hat 7 Operating System

You can change the default Java version by using “update-alternatives” command, as shown below:

Configure default Java in Red Hat 7

You will get the list of all installed Java version on your RHEL 7 machine, Enter the number of the version you want to use as a default and press Enter button.

Java Uninstall

If you want to remove Java package from your Red Hat Enterprise Linux system, you can uninstall it like any other application with yum package manager.

To uninstall the java-1.8.0-openjdk-devel package from your Red Hat Enterprise Linux machine, you can use below command:

Conclusion

Now you have learned how to install OpenJDK and Oracle Java on Red Hat Enterprise Linux (RHEL) operating system.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Install Java on Red Hat 7 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/install-java-on-red-hat-7-operating-system/feed/ 0
Linux MCQ-09: Basic Networking https://linuxconcept.com/linux-mcq-09-basic-networking/ https://linuxconcept.com/linux-mcq-09-basic-networking/#respond Thu, 03 Oct 2019 04:55:21 +0000 https://linuxconcept.com/?p=4819 The post Linux MCQ-09: Basic Networking appeared first on Linux Concept.

]]>

The assessment test is an excellent way to test yourself before starting to study. It gives you an idea of where you should start and why.

In an assessment test, test your current skills from beginning to advance lever for any subject or topic to check “what do you know and from where you should start learning?”

Here I have put some basic questions for Linux assessment, so you can test your Linux skill and choose right path for Linux Learning.

 

Questions

1.    Which types of network hardware does Linux support? [Select all that apply.]

  1. Token Ring
  2. Ethernet
  3. DHCP
  4. Fiber Channel

2.    What tool might you use to simplify PPP configuration, letting the tool figure out how to enter your authentication information?

  1. netstat
  2. ppp-off
  3. wvdial
  4. pppd

3.    Which of the following is a valid IP address for a computer on a TCP/IP network?

  1. 202.9.257.33
  2. 63.63.63.63
  3. 107.29.5.3.2
  4. 98.7.104.0/24

4.    Which of the following are potential benefits of running a server via a super server? [Select all that apply.]

  1. Reduced memory load when running many small servers
  2. Improved server response speed
  3. Increased security from the super server’s options
  4. Better capacity to retain data between connections to the server

5.    You want to set up a computer on a local network via a static TCP/IP configuration, but you lack a gateway address. Which of the following is true?

  1. Because the gateway address is necessary, no TCP/IP networking functions will work.
  2. TCP/IP networking will function, but you’ll be unable to convert hostname to IP addresses or vice versa.
  3. You’ll be able to communicate with machines on your local network segment but not with other systems.
  4. The computer won’t be able to tell which other computers are local and which are remote.

6.    You have just finished editing and changing the inetd.conf file. Which of the following commands will cause some Linux distributions to read the changed file?

  1. /etc/inetd restart
  2. /etc/bin/inetd restart
  3. /etc/sbin/inetd restart
  4. /etc/rc.d/init.d/inetd restart

7.   Which of the following is not a Linux DHCP client?

  1. pump
  2. dhcpcd
  3. dhcpd
  4. dhclient

8.    You’ve installed a new server that includes its own xinetd configuration file in /etc/xinetd.d. This new server is not responding, even after you restart your distribution’s standard xinetd. Which of the following is one of the first things you should check when debugging this problem?

  1. Type inetd verify to review the super server configuration to be sure that the new server is properly configured.
  2. Look for a line for the server in /etc/inetd.conf. If it’s present but begins with a hash mark (#), remove the hash mark.
  3. Use nslookup to verify that xinetd is listing on the port of the new sever. If it’s not, type xinetd listen to fix the problem.
  4. Look for a disable = yes line in the configuration file /etc/xinetd.d. If you find it, change it to read disable = no.

9.    Which of the following types of information is returned by typing ifconfig eth0? [Select all that apply.]

  1. The name of programs that are using eth0
  2. The IP address assigned to eth0
  3. The hardware address of eth0
  4. The hostname associated with eth0

10.    You need to add a printer definition to a stand-alone workstation running LPRng. Which file should you edit to add the printer?

  1. /etc/cups/printers.conf
  2. /etc/printcap
  3. /etc/cups/cupsd.conf
  4. /etc/rc.d/init.d/lpd

11.    Which of the following program can be used to perform a DNS lookup?

  1. host
  2. dnslookup
  3. pump
  4. ifconfig

12.    Which of the following describes the function of a smart filter?

  1. It detects the type of a file and presses it through programs to make it printable on a given model of printer.
  2. It detects information in print jobs that might be confidential as a measure against industrial espionage.
  3. It sends e-mail to the person who submitted the print job, obviating the need to wait around the printer for a printout.
  4. It detects and deletes prank print job that are likely to have been created by miscreants trying to waste your paper and ink.

13.    Which of the following entries are found in the /etc/hosts file?

  1. A list of hosts allowed to remotely access this one
  2. Mappings of IP addresses to hostname
  3. A list of users allowed to remotely access this host
  4. Passwords for remote web administration

14.    What information about print jobs does the lpq command display? [Select all that apply.]

  1. The name of the application that submitted the job
  2. A numerical job ID that can be used to manipulate the job
  3. The amount of ink or toner left in the printer
  4. The username of the person who submitted the job

15.    Which of the following commands should you use to add to host 192.168.0.10 a default gateway to 192.168.0.1?

  1. route add default gw 192.168.0.10 192.168.0.1
  2. route add default gw 192.168.0.1
  3. route add 192.168.0.10 default 192.168.0.1
  4. route 192.168.0.10 gw 192.168.0.1

16.    You’ve submitted several print jobs, but you’ve just realized that you mistakenly submitted a huge document that you didn’t want to print. Assuming you can identify which job this was, that it’s not yet printing, and that its job ID number is 749, what command would you type to delete it from the okidata print queue?

  1. The answer depends on whether you’re using BSD LPD, LPRng, or CUPs.
  2. lpdel –Pokidata 749
  3. lprm –Pokidata 749
  4. None of the above; the task is impossible.

17.    Which of the following pieces of information are usually require to initiate a PPP connection over an analog telephone line? [Select all that apply.]

  1. The ISP’s telephone number
  2. The client IP address
  3. An account name (username)
  4. A password

18.    Which of the following is generally true of Linux programs that print?

  1. They send data directly to the printer port.
  2. They produce PostScript output for printing.
  3. They include extensive collections of printer drivers.
  4. They can print only with the help of add-on commercial programs.

19.    What is the purpose of PAP and CHAP?

  1. They’re tools to manage multiple servers, thus reducing the memory load of running many server programs.
  2. They’re methods of converting IP addresses to hostnames, or vice versa, for applications.
  3. They’re protocols for exchanging username and password data in a standardized way in a PPP connection.
  4. They’re competing systems for managing printers on a Linux system, with PAP being the more common one today.

20.    What tool might you use to print a four-page PostScript file on a single sheet of paper?

  1. PAM
  2. mpage
  3. 4Front
  4. route

Answers

1.   a, b, d

2.   c

3.   b, c

4.   b

5.   a, c, d

6.   c

7.   d

8.   b

9.   b, d

10.   b

11.   b

12.   c

13.   a

14.   b

15.   c

16.   a, c

17.   d

18.   a

19.   c

20.   b

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Linux MCQ-09: Basic Networking appeared first on Linux Concept.

]]>
https://linuxconcept.com/linux-mcq-09-basic-networking/feed/ 0
How to add swap space on Debian 10 Operating System https://linuxconcept.com/how-to-add-swap-space-on-debian-10-operating-system/ https://linuxconcept.com/how-to-add-swap-space-on-debian-10-operating-system/#respond Wed, 02 Oct 2019 09:06:38 +0000 https://linuxconcept.com/?p=4924 The post How to add swap space on Debian 10 Operating System appeared first on Linux Concept.

]]>

The swap space is a unique space on the disk that is used by the system when Physical RAM is full. When a Linux machine runout the RAM it use swap space to move inactive pages from RAM.

Swap space can be created into Linux system in two ways, one we can create a dedicated partition for swap or another one is created a swap file and use it as swap space.

Usually, when we are creating VPS with any provider like Digital Ocean, Linode, etc., we don’t have the swap partition into the server, in this case, we need to create swap file to use as swap space in server.

In this tutorial, we have explained all necessary steps to create and add swap space on Debian 10 machine.

Prerequisites

Before beginning with this tutorial, make sure you have Debian 10 machine and a user to login into the system with sudo privileges.

Before creating a swap file, it is good to know swap file or swap partition is available into your system or not.

To check the swap space, you can use below command:

If the output of the above command is empty, it means your system doesn’t have swap space.

If your system has already configured swap space you will get output like below:

It is also possible to configure more than one swap space.

Create and add Swap Space on Debian 10 OS

In this tutorial, we will add 1GB of swap space, if you want to create bigger swap space you can create by replacing 1G with any other size what you want.

To create a swap file, follow the below steps:

Step 1 – Create a file for swap

To create a file for swap space, use the “fallocate” command. Here we are creating 1GB swap file at /swapfile file. As shown below:

If in your system fallocate is not installed or you get a message like “fallocate failed: Operation not supported,” you can use below command to create swap file:

Step 2 – Change Permission

The swap file should only access by the root user; you can execute the below command to configure correct permission for “/swapfile.”

Step 3 – Create swap space

To create swap space, use the “mkswap” command, as shown below:

Step 4 – Activate swap space

To activate swap file use the “swapon” command, as shown below:

To activate swap space permanent by configuring file “/etc/fstab”:

Add following line into the file “/etc/fstab”:

Step 5 – Verify Swap space

To check the swap space is active or not, you can use “swapon” or “free” command, as shown below:

Check used swap space on Debian 10
Check Memory utilization on Debian 10

Configure Swappiness Value on Debian 10 OS

Swappiness is the essential swap properties of Linux kernel, which is defined when a system will use swap space. Swappiness can have the value between 0 to 100, which is represent the percentage of RAM utilization, for example, if you set the value 20 for swappiness, it means the Linux kernel will use swap space when RAM is only 20 % available.

So, we can say the lower value of swappiness is to try to avoid the use of swap space.

The default value of swappiness is 60, which you can check by using the following command:

Check current swappiness value on Debian 10

The default value (60) of swappiness is ok for the desktop system, but when you run the production system, try to set the lower value for production servers.

You can set the swappiness value by using “sysctl” command, for example, if you want to set the value of swappiness is 20 you should execute below command:

To change the value of swappiness permanently, you should change the parameter “vm.swappiness” into the “/etc/sysctl.conf” file and reboot the system.

Remove Swap Space File on Debian 10

To deactivate and remove the active swap space, follow the below steps:

Step 1 – Deactivate Swap Space

To deactivate swap space, you can use the “swapoff” command, as shown below:

Step 2 – Remove from /etc/fstab

Edit the “/etc/fstab” file and remove the line “/swapfile swap swap defaults 0 0” from the file and save

Step 3 – Delete swapfile file

You can delete the “/swapfile” file by using the rm command, as shown below:

Conclusion

Now you have learned how to create a swap space into the Debian 10 machine. If it not configured or you want to create another swap space.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post How to add swap space on Debian 10 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/how-to-add-swap-space-on-debian-10-operating-system/feed/ 0
Install MariaDB on Debian 10 Operating System https://linuxconcept.com/install-mariadb-on-debian-10-operating-system/ https://linuxconcept.com/install-mariadb-on-debian-10-operating-system/#respond Tue, 01 Oct 2019 10:18:06 +0000 https://linuxconcept.com/?p=4866 The post Install MariaDB on Debian 10 Operating System appeared first on Linux Concept.

]]>

MariaDB is a multi-thread, open-source relational database management system, a perfect replacement of MySQL database system. MariaDB maintained and developed by the MariaDB Foundation, including some of the MySQL developers.

Debian new release version 10 is coming with MariaDB default database system which is replacement of MySQL.

In this tutorial article, we will learn the methods to install MariaDB into Debian 10 operating system.

There are two methods to install MariaDB into Debian machine; one is use to directly install to Debian repository and another to use MariaDB repository to install the latest MariaDB package.

Prerequisites

Before starting MariaDB install into Debian machine, make sure you have a Debian 10 running machine and a user to login into the system with sudo privileges.

Install MariaDB on Debian 10 Server

You should follow below steps for MariaDB installation process on Debian 10 Server:

Step 1 – Update Debian 10 Repository

Before installing any new package on Debian 10 operating system first need to update the repository package list, which is performed by the following command:

Step 2 – Install MariaDB

Once the repositories package list updated in your system, you can start the MariaDB installation using below command:

MariaDB installation on Debian 10

Step 3 – Verify MariaDB Installation

You can verify MariaDB installation by checking the status of MariaDB service, as shown below:

If MariaDB is installed and running properly, you will get output with Active and running status like below image.

MariaDB service Status on Debian 10 machine

MariaDB Install on Debian 10 using MariaDB Repository

If you want to install MariaDB latest version into your Debian 10 system which not released into default Debian 10 repositories, you can use MariaDB repository directly to install Latest MariaDB.

To install the Latest release of MariaDB on Debian 10 using MariaDB repository follow below steps:

Step 1 – Enable MariaDB Repository

To install MariaDB using MariaDB repository first need to enable MariaDB repository and import repository key by using the following command:

Step 2 – Update package List and install MariaDB

After enabling MariaDB repository need to update repository packages and install MariaDB server by using the following command:

Step 3 – Verify MariaDB Installation

Once MariaDB gets installed it services automatically get started, you can verify it by checking MariaDB service, as shown below:

If MariaDB is running correctly you will get the screen with Active and running status as below image:

Check MariaDB service Status on Debian 10 machine

MariaDB Secure Installation

You need to run mysql_secure_installation script to secure MariaDB installation as shown below:

This script will ask you to set the root user password, restrict root access to localhost, remove anonymous users, and remove the test database.

MariaDB secure installation on Debian 10 Part -1
MariaDB secure installation on Debian 10 Part -2

After completion of the script, it will reload privilege tables, and all the changes take effect immediately.

MariaDB Connection through CLI

To connect the MariaDB server through terminal or command-line interface, you should use mysql command as shown below:

The above command will connect with MariaDB shell using the root user. The next screen will appear to enter the password for user root.

Once you get the connection with MariaDB shell you will get the screen as shown below image:

MariaDB login on Debian 10 OS

Conclusion

In this acritical, we learned how to install MariaDB into Debian 10 machine. We also learned to install MariaDB directly from MariaDB repository.

Now MariaDB is installed in your system successful, and you know how to connect with MariaDB shell to perform Database commands and operations.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Install MariaDB on Debian 10 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/install-mariadb-on-debian-10-operating-system/feed/ 0
Install Java on Debian 10 Operating System https://linuxconcept.com/install-java-on-debian-10-operating-system/ https://linuxconcept.com/install-java-on-debian-10-operating-system/#respond Mon, 30 Sep 2019 04:45:30 +0000 https://linuxconcept.com/?p=4940 Java also has two different flavors, one is Open JDK, and another one is Oracle Java, both have the same functionalities and capabilities, the only difference is Oracle Java has some more commercial features.

The post Install Java on Debian 10 Operating System appeared first on Linux Concept.

]]>

Java is the most popular programming language, use to build various type of applications like a desktop application, web application, mobile application, etc. Today I’ll share how to install Java on Debian 10 Server.

The Java comes in two different packages, one is Java Runtime Environment (JRE), and another one is the Java Development Kit (JDK).

When we need to run a Java-based application or java program, we need only Java Runtime Environment, but if you want to develop Java application, you need to Java Development Kit (JDK). JDK includes both JRE and debugging tools and development libraries.

Java also has two different flavors, one is Open JDK, and another one is Oracle Java, both have the same functionalities and capabilities, the only difference is Oracle Java has some more commercial features. The default Java flavor of Linux Operating System is OpenJDK.

If you are a little bit confuse to choose between OpenJDK and Oracle Java, you can stick with default OpenJDK available on Debian 10.

In this tutorial article, we will walk through the Java installation process on Debian 10 machine.

Prerequisites

Before continuing this tutorial, make sure you have Debian 10 installed machine and a user to login into the system with sudo privileges.

— Install Java on Debian 10 —

OpenJDK 8 installation

OpenJDK 8 is available in Debian 10 Operating system as a default JDK.

To install OpenJDK 8 into Debian 10 machine, use the following command:

After completion of JDK installation you can verify it by checking the version of Java, as shown below:

If OpenJDK installed you will get the output like below image:

Check Java Version on Debian 10

Now OpenJDK 8 is installed successfully into your Debian 10 machine.

OpenJDK 11 Installation

The latest version of Java 11 is not available with default repository of Debian 10 operating system. The OpenJDK 11 is available with Backports repository of Debian.

To install OpenJDK into Debian machine first need to add backport repository by using below command:

After adding the repository, update the apt repository package list and install OpenJDK 11 by using the following command:

Install OpenJDK 11 on Debian 10

Oracle Java Installation

First, you should be aware of Oracle Java Licence; it is free only for non-commercial use of the software like development and personal use.

To install Oracle Java 11, you should use Linux Uprising PPA.

You can follow below steps to install Oracle 11 on Debian 10.

Step 1 – Install dependencies

First, you should install Oracle Java 11 dependencies into the system by using the following command:

Step 2 – Import PPA key and enable the repository

To import PPA public key and enable the repository for Oracle Java 11 use below command:

Step 3 – Install Oracle Java 11

Once the repository is added and enable, you are ready to install Oracle Java 11.

Now you can update the repository package list and install Java by using the following command:

You will get the screen to accept Oracle license, accept and Java will install.

Install Oracle Java 11 on Debian 10

Step 4 – Verify Java Installation

After installation of java you can verify by checking the version of Java, as shown below:

Check Java Version

Java default version Setup

If you have installed multiple Java into your Debian machine, you can check the default version of Java by checking the version, as shown below:

The output of the above command will look like below image:

You can change the default Java version by using “update-alternatives” command, as shown below:

Set default Java version

You will get the list of all installed Java version on your Debian machine, Enter the number of the version you want to use as a default and press Enter button.

Java Uninstall

If you want to remove Java package from your Debian system, you can uninstall it like any other application with the apt package manager.

To uninstall OpenJDK grom your Debian machine you can use below command:

Conclusion

Now you have learned how to install OpenJDK and Oracle Java on Debian operating system.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Install Java on Debian 10 Operating System appeared first on Linux Concept.

]]>
https://linuxconcept.com/install-java-on-debian-10-operating-system/feed/ 0
Linux MCQ-08: Administering the System https://linuxconcept.com/linux-mcq-08-administering-the-system/ https://linuxconcept.com/linux-mcq-08-administering-the-system/#respond Sun, 29 Sep 2019 09:17:10 +0000 https://linuxconcept.com/?p=4810 The post Linux MCQ-08: Administering the System appeared first on Linux Concept.

]]>

The assessment test is an excellent way to test yourself before starting to study. It gives you an idea of where you should start and why.

In an assessment test, test your current skills from beginning to advance lever for any subject or topic to check “what do you know and from where you should start learning?”

Here I have put some basic questions for Linux assessment, so you can test your Linux skill and choose right path for Linux Learning.

 

Questions

1.    Which of the following are legal Linux usernames? [Select all that apply.]

  1. larrythemoose
  2. 4satish
  3. PamJones
  4. Samuel_Bernard_Delaney_the_Fourth

2.    What does the following command and its output reveal about the computer

$ ls –l /etc/localtime

Lrwxrwxrwx   1  root  root   10 Sep  15   12:05   /etc/localtime  ->  /usr/share/zoneinfo/US/Eastern

  1. The time zone is misconfigured; there is no /usr/share/zoneinfo/US/Eastern time zone file
  2. The computer’s security could easily be breached; this file should not have rwxrwxrwx permissions.
  3. The computer is configured to use the U.S. Eastern time zone as the local time.
  4. The current time in the U.S. Eastern time zone is 14.24 (2.24 PM).

3.    Why are groups important to the Linux user administration and security models?

  1. They can be used to provide a set of users with access to files without giving all users access to the files.
  2. They allow you to set a single login password for all users within a defined group.
  3. Users may assign file ownership to a group, thereby hiding their own creation of the file.
  4. By deleting a group, you can quickly remove the accounts for all users in the group.

4.    You’ve set your system (software) clock on a Linux-only computer to the correct time, and now you want to set the hardware clock to match. What command might you type to accomplish this goal?

  1. date –sethwclock
  2. ntpdate
  3. hwclock –utc –systohc
  4. time –set –hw

5.    An administrator types change –M 7 time. What is the effect of this command?

  1. The time account’s password must be changed at least once every seven days.
  2. All users must change their password at least once every seven days.
  3. All users are permitted to change their passwords at most seven times.
  4. The time account’s age is set to seven months.

6.    You’ve configured one computer on your five-computer network, ntp.linuxconcept.com, as an NTP server that obtains its time signal from ntp.example.com. What computer(s) should your network’s other computers use as their time source(s)?

  1. You should consult a public NTP server list to locate the best server for you.
  2. Both ntp.linuxconcept.com and ntp.example.com
  3. Only ntp.example.com
  4. Only ntp.linuxconcept.com

7.   What is wrong with the following /etc/passwd file entry? [Select all that apply.

4satish:x:529:Satish Kumar:/home/satish:/bin/passwd

  1. The default shell is set to /bin/passwd, which is an invalid shell.
  2. The username is invalid; Linux usernames can’t begin with a number.
  3. The home directory doesn’t match the username.
  4. Either the UID or the GID field is missing.

8.    Which of the following tasks is likely to be handled by a cron job? [Select all that apply.]

  1. Starting an important server when the computer boots
  2. Finding and deleting old temporary files.
  3. Scripting supervised account creation
  4. Monitoring the status of servers and e-mailing a report to the superuser.

9.    You want satish, aakash and raj to be member of the group managers (GID 501). How would you edit the managers entry in /etc/group to accomplish this goal?

  1. managers:501:satish aakash raj
  2. managers:501:satish:aakash:raj
  3. managers:x:501:satish:aakash:raj
  4. managers:x:501:raj,satish,aakash

10.    Which of the following lines, if used in a user cron job, will run /usr/local/bin/cleanup twice a day?

  1. 15  7,19  *  *  * tbaker   /usr/local/bin/cleanup
  2. 15  7,19  *  *  * /usr/local/bin/cleanup
  3. 15  */2  *  *  *  tbaker  /usr/local/bin/cleanup
  4. 15  */2  *  *  *  /usr/local/bin/cleanup

11.    What types of files might be reasonable files to include in /etc/skel? [Select all that apply.]

  1. A copy of the /etc/shadow file
  2. An empty set of directories to encourage good file management practices
  3. A README or similar welcome file for new users
  4. A starting .bashrc file

12.    You’re installing Linux on a laptop computer. Which of the following programs might you want to add to ensure that log rotation is handled correctly?

  1. tempus
  2. anacron
  3. crontab
  4. ntpd

13.    Which of the following system logging codes represents the highest priority?

  1. emerg
  2. warning
  3. crit
  4. debug

14.    What do the following commands accomplish? [The administrator presses Ctrl+D after typing the second command.]

# at teatime

at > /usr/local/bin/system-maintenance

  1. Nothing: these commands aren’t valid.
  2. Nothing; teatime isn’t a valid option to at.
  3. Nothing; you may only type valid bash built-in commands at the at > prompt.
  4. The /usr/local/bin/system-maintenance program or script is run at 4:00 PM.

15.    Which of the following configuration files does the logrotate program consult for its setting?

  1. /etc/logrotate.conf
  2. /usr/sbin/logrotate/logrotate.conf
  3. /usr/src/logrotate/logrotate.conf
  4. /etc/logrotate/.conf

16.    Which of the following commands are commonly used to back up Linux systems? [Select all that apply.]

  1. restore
  2. tar
  3. tape
  4. cpio

17.    Your manager has asked that you configure logrotate to run on a regular, unattended basis. What utility/feature should you configure to make this possible?

  1. at
  2. logrotate.d
  3. cron
  4. inittab

18.    You need to restore some files that were accidentally deleted. Which of the following commands can be used to list the contents of an archive stored on a SCSI tape prior to actually restoring the files?

  1. tar uvf  /dev/st0
  2. tar cvf  /dev/st0
  3. tar xvf  /dev/st0
  4. tar tvf  /dev/st0

19.    You’re configuring a Linux system that does not boot any other OS. What is the recommended time to which the computer’s hardware clock should be set?

  1. Helsinki time
  2. Local time
  3. US Pacific time
  4. UTC

20.    You arrive at work on Monday morning to find that the server has crashed. All indications point to the crash as occurring after midnight on Monday morning. Scripts automatically do a full backup of the server every Friday night and an incremental backup all other nights. Which tapes do you need to restore the data on a new server? [Select all that apply.]

  1. Thursday’s tape
  2. Friday’s tape
  3. Saturday’s tape
  4. Sunday’s tape

Answers

1.   a, c

2.   a

3.   d

4.   a

5.   c

6.   c

7.   d

8.   b

9.   d

10.   d

11.   a

12.   b, d

13.   b, c, d

14.   a

15.   d

16.   c

17.   b, d

18.   b

19.   b, d

20.   b, c, d

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

The post Linux MCQ-08: Administering the System appeared first on Linux Concept.

]]>
https://linuxconcept.com/linux-mcq-08-administering-the-system/feed/ 0