Learn Linux Quickly
eBook - ePub

Learn Linux Quickly

A beginner-friendly guide to getting up and running with the world's most powerful operating system

Ahmed AlKabary

Buch teilen
  1. 338 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Learn Linux Quickly

A beginner-friendly guide to getting up and running with the world's most powerful operating system

Ahmed AlKabary

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Learn over 116 Linux commands to develop the skills you need to become a professional Linux system administratorKey Features• Explore essential Linux commands and understand how to use Linux help tools• Discover the power of task automation with bash scripting and Cron jobs• Get to grips with various network configuration tools and disk management techniquesBook DescriptionLinux is one of the most sought-after skills in the IT industry, with jobs involving Linux being increasingly in demand. Linux is by far the most popular operating system deployed in both public and private clouds; it is the processing power behind the majority of IoT and embedded devices. Do you use a mobile device that runs on Android? Even Android is a Linux distribution. This Linux book is a practical guide that lets you explore the power of the Linux command-line interface. Starting with the history of Linux, you'll quickly progress to the Linux filesystem hierarchy and learn a variety of basic Linux commands. You'll then understand how to make use of the extensive Linux documentation and help tools. The book shows you how to manage users and groups and takes you through the process of installing and managing software on Linux systems. As you advance, you'll discover how you can interact with Linux processes and troubleshoot network problems before learning the art of writing bash scripts and automating administrative tasks with Cron jobs. In addition to this, you'll get to create your own Linux commands and analyze various disk management techniques. By the end of this book, you'll have gained the Linux skills required to become an efficient Linux system administrator and be able to manage and work productively on Linux systems.What you will learn• Master essential Linux commands and analyze the Linux filesystem hierarchy• Find out how to manage users and groups in Linux• Analyze Linux file ownership and permissions• Automate monotonous administrative tasks with Cron jobs and bash scripts• Use aliases to create your own Linux commands• Understand how to interact with and manage Linux processes• Become well-versed with using a variety of Linux networking commands• Perform disk partitioning, mount filesystems, and create logical volumesWho this book is forThis book doesn't assume any prior Linux knowledge, which makes it perfect for beginners. Intermediate and advanced Linux users will also find this book very useful as it covers a wide range of topics necessary for Linux administration.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Learn Linux Quickly als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Learn Linux Quickly von Ahmed AlKabary im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatique & Administration du système. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2020
ISBN
9781800561205
Controlling the Population
Linux is a multiuser operating system, which means that many users are allowed to access the system at the same time. In real life, you barely find a Linux server with just one user. On the contrary, you see a lot of users on one server. So let's get real and populate our system with various users and groups. In this chapter, you will learn how to add users and groups to your Linux system. You will also learn how to manage user and group accounts in all sorts of ways. Furthermore, you will also learn how to manage Linux file permissions.

The /etc/passwd file

In Linux, user information is stored in the /etc/passwd file. Every line in /etc/passwd corresponds to exactly one user. When you first open /etc/passwd, you will see a lot of users, and you will wonder, where are all these users coming from? The answer is simple: most of these users are service users, and they are used by your system to start up various applications and services. However, our main focus of this chapter will be system users; those are real people like you and me!
Every line in /etc/passwd consists of 7 fields, each separated by a colon, and each field represents a user attribute. For example, the entry for user elliot will look something like this:
Figure 1: The 7 fields in /etc/passwd
The following table breaks down those seven fields in /etc/passwd and explains each one of them:

Field
What does it store?
1
This field stores the username.
2
This field usually has an X in it, which means the user's password is encrypted and stored in the file /etc/shadow.
3
This field stores the UID (User ID) number.
4
This field stores the primary GID (Group ID) of the user.
5
This field stores a comment on the user, which is usually the user's first and last name.
6
This field stores the path of the user's home directory.
7
This field stores the user's default shell.
Table 10: Understanding /etc/passwd

Adding users

Before you can add a user on your system, you have to become root:
elliot@ubuntu-linux:~$ su - 
Password:
root@ubuntu-linux:~#
Now, we are ready to add users. We all love Tom & Jerry, so let's begin by adding user tom. To do that, you need to run the command useradd -m tom:
root@ubuntu-linux:~# useradd -m tom
And just like that, the user tom is now added to our system. You will also see a new line added to the end of the /etc/passwd file for the new user tom; let's view it with the lovely tail command:
root@ubuntu-linux:~# tail -n 1 /etc/passwd 
tom:x:1007:1007::/home/tom:/bin/sh
We used the -m option with the useradd command to ensure that a new home directory will be created for user tom. So let's try to change to the /home/tom directory to make sure it's indeed created:
root@ubuntu-linux:~# cd /home/tom 
root@ubuntu-linux:/home/tom# pwd
/home/tom
Awesome! We verified that /home/tom is created.
The first thing you may want to do after creating a new user is to set the user's password. You can set tom's password by running the command passwd tom:
root@ubuntu-linux:~# passwd tom 
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Now, let's create user jerry. But this time, we will choose the following attributes for user jerry:
UID
777
Comment
Jerry the Mouse
Shell
/bin/bash
This is easy to do with the useradd command:
root@ubuntu-linux:~# useradd -m -u 777 -c "Jerry the Mouse" -s /bin/bash jerry
The -u option is used to set the UID for jerry. We also used the -c option to add a comment for user jerry, and finally we used the -s option to set the default shell for jerry.
Now, let's view the last two lines of the /etc/passwd file to make some comparisons:
root@ubuntu-linux:~# tail -n 2 /etc/passwd 
tom:x:1007:1007::/home/tom:/bin/sh
jerry:x:777:1008:Jerry the Mouse:/home/jerry:/bin/bash
Notice how the comment field for user tom is empty as we didn't add any comments while creating user tom, and notice how the UID for user tom was chosen by the system, but we have chosen 777 for user jerry. Also, notice that the default shell for user tom is chosen by the system to be /bin/sh, which is an older version of /bin/bash. However, we chose the newer shell /bin/bash for user jerry.
Now, let's set the password for user jerry:
root@ubuntu-linux:~# passwd jerry 
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Amazing! We have now created two users: tom and jerry. Now, let's switch to user tom:
root@ubuntu-linux:~# su - tom
$ whoami tom
$ pwd
/home/tom
$
We were able to switch to user tom, but as you can see, the shell looks so much different as the command prompt doesn't display the username or the hostname. That's because the default shell for user tom is /bin/sh. You can use the echo $SHELL com...

Inhaltsverzeichnis