This is the video transcription: Welcome to a new video tutorial. In this case, we are going to see today the security in the Linux Operating System and for this the topic that we are going to see is the configuration of the restrictions in Linux with one of the configuration files. Specifically it is the file located in //etc//security//limits.conf. In this type of plain text file we are going to see how to configure the restrictions that are classified into two categories, soft and hard. We can call them permissive and stricter. We are going to see several examples of how to configure these restrictions to apply them to both users and groups. Well, let's get right down to business. I connect through the PuTTY tool to my Linux server via SSH. I'm here with an Ubuntu 20.04 which is an Ubuntu based on Linux Mint, from the Linux Mint distribution. Well, 23. We are going to see punctually this topic of the file. I'm going to become root so I don't have permissions issues. Let's enlarge this window so you can see it clearly. Let's take a look at that file. It is a plain text file, as you can see, quite simple, where it gives us an explanation. It gives us an explanation of how the restrictions are going to be formatted. The first thing that is included is a domain to which it refers. A domain can be a group, a user or a wildcard. Then comes the type of constraint. If it is going to be soft or hard, that here it puts it, very strict or more permissive. Then the item that we are going to configure, to which we are going to explain the restrictions. The item could be the number of simultaneous logins to the system in total, the number of a user, the number of logins at the same time for a certain user or for all members of a certain group. And indeed the value, how many logins, for example, we want to restrict as maximum of access to the system to a group or a user. Well, throughout this file here you can see each one of the values. For example, here we see the fsize, file size. That is, this means that a user that enters a system can create a maximum file size to avoid that people create too big files and fill the storage volumes, the partitions. Well, here we also have the number of open file descriptors. The descriptors are when a process is executed, a series of operations are executed and those series of operations can consist of file opens. Well, we can restrict this to a maximum so that a process, when it does certain operations, can open up to a maximum number of file descriptors and so we don't crash the system. The maximum memory size that can be used, the maximum CPU time that can be used by a certain process started by a certain user, maximum number of processes. Well, in short, here are the maximum number of entries to the system for a given user or group or for the members of that group. And this is the total number of users that may be in the system at any given time. All this is also for the execution priority of the processes, that can be given to a process to a certain user, the locks. Well, in short, there are several things. Of course, in this type of file it is not possible to establish priorities, restrictions, excuse me, to the user or to the root group. Here, as you can see, I have some examples configured. I added it by hand. For example, here I have put that the user GB has a type of strict priority in the amount of simultaneous accesses to the system limited in two. And I've also put another line that says that for all users, with the asterisk for all users, also strictly, the amount of simultaneous logins to the system is also limited by two. Of course, I said, all this applies to all users except the root user. Here, when it starts with the at sign, it refers to the group. This admin group, all members of the admin group, so to speak, also have a strict restriction of maximum two logins at the same time. Well, let's check if they work. We play the changes, we log out. For example, if we do with the W key, we see the number of users. We see that the user GB already has two open sessions. With which, if we would try to make a third session, for example, we open another PuTTY making right button on the superior bar and we give duplicate session or new session, anyone. I am going to minimize the session in the back to show it. I go to enter with GB and, in theory, it doesn't let me enter anymore. That session kicks me out, cuts me off and I still have two here. We can try with, as we had put, we had put a restriction on all members of the admin group. Here it's set, that all members of the admin group also have a maximum of two logins configured. Let's see who are the members of the admin group. If we do the groups command and the group name, it tells us who the, sorry, the admin user is a member of the admin group and also his two. If we do groups for the user GB it will give us back what groups the user GB belongs to. The user GB belongs to all these groups and among them also the admin. Well, let's try with the admin user. Let's right click here. Duplicate session. We are going to say we enter with admin. It has to let me in because I already have it. If I run W to see, I see that I have two GB sessions open and one from the admin user. Well, could the admin user have access to one more session, to a second session. We give duplicate session, we put admin, its password and also we see that it already lets us enter and we already have two sessions of the user GB, two sessions of the group admin. Now, if we now try a new session, duplicate session for admin, it should no longer let us in. It kicked us out and went back to the previous session. I still have a total of four sessions, two from the GB user, two of the admin user. Well, a little bit of these sessions to work a little bit more comfortable. Let's go back to the session here where we say root. We re-edit the file and we're going to add one, for example, with the parameter fsize. Yes? Maximum file size. Then, we can say, for example, that for the admin user, for example, we are going to put a strict restriction. We are going to put him that the item fsize, this is in kilobytes, so that he cannot create files of more than two megabytes. That is the indicative, 2,048 kilobytes make two megabytes. We save changes. We leave and now we are going to enter session. Duplicate session. We enter with admin. We are already inside. Let's see, we still have two GB sessions and one admin session, so everything is fine. Now what we see is that this user cannot generate files larger than two megabytes. Well, how do we do a test? Well, let's look for a large file. I know that in bar.home.gb there can be something big. Let's look for a small file here. And if not, in CDE. Here we have a file, for example, this one of 84 megabytes or this smaller one of 34 megabytes. For example, this one of 34 megabytes is the telegram installer. For example, if we copy that file, we make a cp-v so that it indicates us detailed of that file and we are going to copy it in the folder bar.home.admin. Exceeded the limit. We see that the restriction is working perfectly. It tells you that the file limit is exceeded. So that file in the admin folder here it has not been copied and it is correct. That is, it tells you. It leaves you up to two megabytes. Everything else is not copied. It copies up to two megabytes because it applies the restriction. Well, that's kind of the way this file works. It is basically to write the restriction that we want to apply and to establish if we want the type of restriction to be stricter, softer or less restrictive and based on that to configure any of these parameters that are here. I insist, the restrictions for root do not apply for the user as well as for the group. Well, let's leave it here. I think it's pretty straightforward and I hope you find it useful. See you in the next one.