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

Condividi libro
  1. 338 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Learn Linux Quickly

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

Ahmed AlKabary

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Learn Linux Quickly è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Learn Linux Quickly di Ahmed AlKabary in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Administration du système. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2020
ISBN
9781800561205
Edizione
1
Argomento
Informatique
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...

Indice dei contenuti