02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

How to remove an unwanted linux user

Every user that you add your not only adding a user but your adding a new folder just like users on your desktop that contain information on the user and files that the user stored (such as the files on your desktop). As such we want to delete the user and all the associated files with that user so we will add to the command the '-r' rule (this is unreleasable):

userdel -r USERNAME

Video Transcript

00:00Now, every user that you add, you're not only adding a user, you're also adding a lot of
00:05files.
00:06You're basically just like on your desktop, just like on your personal computer, there's
00:10like a configuration, a folder, a user's home where he has maybe websites or other
00:15stuff that are inside of his profile, automatically files are created.
00:19So if you just delete the user, it's not going to delete their files.
00:23Now let's see how you delete the user.
00:25By the way, just by creating the user, we've created some files.
00:28So to delete the user, we're going to type user, del, space, the name of the user.
00:36So in our case, it's demo one.
00:38Now what I want to do also before I do that, as we said, we want to recursively remove
00:43every single file that's associated with that user that's inside of that user's account.
00:47And by the way, this is unreversible.
00:49Once we do this, we deleted everything this user has, we're going to type your minus R
00:55right in between user del, minus R, and then the actual user name.
01:00And if I just click here, enter, it's going to delete that user and also get rid of all
01:05the different files that are associated with that user.
01:08So in this video, we saw how to create a user, how to delete a user, and we've also
01:12saw how to update a password.
01:15Last thing I want to talk about before we move on to the next topic is every user
01:20is in a sandbox, a user that is not a root user, that doesn't have a power
01:24control over the system, can't just go into other areas or other users areas and
01:29delete or update their information.
01:32This is very important because you want to protect the files from different users,
01:35if not all the users are root.
01:37For example, if you just opened up a completely new site and you want to give
01:41access to your developers, you might want to create a completely new user and give
01:45access to that user, to your developer, without giving him access to the complete
01:50root, to the complete, not enabling him to change everything on your system.
01:55Okay.
01:56In the next video, we're going to see, we're going to create a new user again,
01:58and we're going to see how do we give him more privileges, more rights than his
02:02default rights.
02:02How do we give him root access?
02:05All right.
02:05So we'll see you in the next video when we talk about that.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!