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

Partager le livre
  1. 338 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et 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

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Learn Linux Quickly est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Learn Linux Quickly par Ahmed AlKabary en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Administration du systĂšme. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
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...

Table des matiĂšres